You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 25, 2018. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 25, 2018. It is now read-only.
Builtin type can be used for .mlapp -> .m conversion on new MATLAB #8
This basically saves us the hassle of unzipping and stripping of the xml...
This functionality was probably added in MATLAB R2016a with the release of the App Designer, so regex-based code is probably still relevant when converting using older versions.
I just tested that using diary to pipe the output to an *.m file functions correctly, but it adds leading and trailing diary commands that need to be removed. It can also be piped to a string with evalc and written to a file with fprintf, which may be the most time expedient option.
I'll add in a check for versions >= R2016a to utilize one of these options to avoid the overhead of unzipping.
The App Designer tech preview was released in October 2014, so I was thinking R2014b or R2014a would have been the earliest they'd start incorporating support. I'll set the flag to R2014b for now.
Should be in now but the regular expressions will need to be compared between versions. The "old" MATLAB handling reads every line of the XML file into its own cell but the type approach reads everything into a single character array.
Activity
sco1 commentedon May 2, 2016
Interesting, good find!
I just tested that using
diaryto pipe the output to an*.mfile functions correctly, but it adds leading and trailingdiarycommands that need to be removed. It can also be piped to a string withevalcand written to a file withfprintf, which may be the most time expedient option.I'll add in a check for versions >= R2016a to utilize one of these options to avoid the overhead of unzipping.
sco1 commentedon May 3, 2016
typeworks on*.mlappfiles in R2015b as well, I don't have any other old versions to test with.Dev-iL commentedon May 3, 2016
Just tested on 2015a - works.
Dev-iL commentedon May 3, 2016
@AnderBiguri tested this on 2014b and it still works. @adeak tested it on 2012b and it doesn't.
sco1 commentedon May 3, 2016
The App Designer tech preview was released in October 2014, so I was thinking R2014b or R2014a would have been the earliest they'd start incorporating support. I'll set the flag to R2014b for now.
Add classdef parsing for newer MATLAB versions
sco1 commentedon May 3, 2016
Should be in now but the regular expressions will need to be compared between versions. The "old" MATLAB handling reads every line of the XML file into its own cell but the
typeapproach reads everything into a single character array.Remove MATLAB version dependency for parsing