How to create exe file from mlapp?
15 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have some questions?
My GUI is running by reading wav files from "ChildrenSong" and images from "images".
- How to add files inside folder? I seem like only add the folder, with any file inside in "Files required for your application to run".
- What I should put on "Files installed for your end user"
0 comentarios
Respuestas (1)
Eric Delgado
el 3 de Dic. de 2022
Are you going to allow the users of your app to add new songs or new images? If so, put those folders in "Files installed for your end user". But if you are not going to allowed this kind of operation and you want to "hide" it, put those folders in "Files required for your application to run". Don't forget to use fullfile to point correctly to your files.
% If you choose "Files installed for your end user" as your solution:
% (1) Create a property named "RootFolder"
% (2) Put the code below in the startup of your app
appName = "NameOfYourApp";
if isdeployed
[~, result] = system('path');
app.RootFolder = char(regexpi(result, 'Path=(.*?);', 'tokens', 'once'));
else
prjPath = matlab.project.rootProject;
appPath = fullfile(char(com.mathworks.appmanagement.MlappinstallUtil.getAppInstallationFolder), appName);
if ~isempty(prjPath) & strcmp(prjPath.Name, appName)
app.RootFolder = char(prjPath.RootFolder);
elseif isfolder(appPath)
app.RootFolder = appPath;
else
error('path of the app...')
end
end
% If you choose "Files required for your application to run" as your solution:
% (1) Create a property named "RootFolder"
% (2) Put the code below in the startup of your app
appName = "NameOfYourApp";
if isdeployed
app.RootFolder = fullfile(ctfroot, appName);
else
prjPath = matlab.project.rootProject;
appPath = fullfile(char(com.mathworks.appmanagement.MlappinstallUtil.getAppInstallationFolder), appName);
if ~isempty(prjPath) & strcmp(prjPath.Name, appName)
app.RootFolder = char(prjPath.RootFolder);
elseif isfolder(appPath)
app.RootFolder = appPath;
else
error('path of the app...')
end
end
% And...
fullfile(app.RootFolder, 'ChildrenSong', 'NameOfTheSong.mp3')
fullfile(app.RootFolder, 'images', 'NameOfTheImage.jpeg')
0 comentarios
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!