m2mlapp

Conversion from .M to .MLAPP (Matlab files)
113 téléchargements
Mise à jour 25 mai 2023

m2mlapp

View m2mlapp on File Exchange

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
Créé avec R2023a
Compatible avec les versions R2021b à R2023a
Plateformes compatibles
Windows macOS Linux
Tags Ajouter des tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
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

Pour consulter ou signaler des problèmes liés à ce module complémentaire GitHub, accédez au dépôt GitHub.
Pour consulter ou signaler des problèmes liés à ce module complémentaire GitHub, accédez au dépôt GitHub.