m2mlapp

版本 1.1.0.0 (13.3 KB) 作者: Eric Delgado
Conversion from .M to .MLAPP (Matlab files)
61.0 次下载
更新时间 2023/5/25

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)

引用格式

Eric Delgado (2024). m2mlapp (https://github.com/EricMagalhaesDelgado/m2mlapp/releases/tag/1.01), GitHub. 检索来源 .

MATLAB 版本兼容性
创建方式 R2023a
兼容 R2021b 到 R2023a 的版本
平台兼容性
Windows macOS Linux
标签 添加标签

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.1.0.0

See release notes for this release on GitHub: https://github.com/EricMagalhaesDelgado/m2mlapp/releases/tag/1.01

要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库