-
Notifications
You must be signed in to change notification settings - Fork 5
Builtin type
can be used for .mlapp -> .m conversion on new MATLAB
#8
Comments
Interesting, good find! I just tested that using I'll add in a check for versions >= R2016a to utilize one of these options to avoid the overhead of unzipping. |
|
Just tested on 2015a - works. |
@AnderBiguri tested this on 2014b and it still works. @adeak tested it on 2012b and it doesn't. |
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. |
MATLAB's type function can natively read and display a *.mlapp's class definition. This is a documented addition to R2016a, but has been tested successfully in R2014b and newer. This allows us to skip the intermediate zip file extraction and XML parsing. Though type does not support an output argument, the output can be piped to a character array using evalc and exported to an *.m file. Resolves: #8
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 |
Piping the output of type creates a character array of the *.m code, where the routine to read in an XML file created a cell array of strings. This introduces compatibility issues and considerations for some of the regex approaches utilized for function call conversions. To eliminate the need to consider the differences in input type, the piped character array from type has been split into a cell array of strings, mimicking the output of the XML parser. See #7, #8, f986a72
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.
The text was updated successfully, but these errors were encountered: