m2mlapp
Conversion from .M to .MLAPP (Matlab files)
M2MLAPP provides the conversion from .M to .MLAPP, enabling GitHub text line based control, and allowing the reconstruction of apps whose .MLAPP files are damaged.
Syntax:
mlappFullPath = m2mlapp(mFileFullPath, varargin);
Arguments:
- mFileFullPath must be a
scalar text (char | string)
with the fullpath to the .M file.
Optional Name-Parameters Arguments:
(argument name, type, and default value)
-
Name
scalar text (char | string)
= ClassName -
Author
scalar text (char | string)
= '' -
Version
scalar text (char | string)
= '1.0' -
Summary
scalar text (char | string)
= '' -
Description
scalar text (char | string)
= 'App code generated by m2mlapp.' -
Screenshot
logical
= true -
OpenApp
logical
= true
Notes:
(a) The images referenced in the app (icon figure, uiimage, uibutton) must be in the Matlab search path during the execution of the m2mlapp function.
(b) After validating the input arguments, the function will return the name of the .MLAPP file, or in case of a parser error, it will return an empty output.
(c) A class loaded in the AppDesigner environment has a fixed structure, which limits customizations. In this structure, the first section is the declaration of components (according to their stacking order); then there are editable sections (properties, methods, and callbacks); and finally, the methods for creating components, and construct or delete the app.
Examples:
Example 1 - Basic convertion (.M >> .MLAPP)
m2mlapp('C:\GitProject\winMain.m', 'Author', 'Eric Magalhães Delgado', 'Version', '1.01');
Example 2 - Rebuilding a broken .MLAPP file (.MLAPP >> .M >> .MLAPP)
mlappFileFullPath = 'C:\GitProject\winMain.mlapp';
[mPath, mFilename] = fileparts(mlappFileFullPath)
mFileFullPath = fullfile(mPath, [mFilename '.m'])
matlabCode = util.extractMATFile(mlappFileFullPath)
writematrix(matlabCode, mFileFullPath, 'FileType', 'text', 'QuoteStrings', false)
movefile(mlappFileFullPath, fullfile(mPath, [mFilename '_old.mlapp']))
m2mlapp(mFileFullPath)
Citation pour cette source
Eric Delgado (2024). m2mlapp (https://github.com/EricMagalhaesDelgado/m2mlapp/releases/tag/1.01), GitHub. Récupéré le .
Compatibilité avec les versions de MATLAB
Plateformes compatibles
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
+util
+validators
Version | Publié le | Notes de version | |
---|---|---|---|
1.1.0.0 | See release notes for this release on GitHub: https://github.com/EricMagalhaesDelgado/m2mlapp/releases/tag/1.01 |