Azzera filtri
Azzera filtri

How does a MATLAB compiled script represent the command window?

26 visualizzazioni (ultimi 30 giorni)
Kealan
Kealan il 25 Giu 2024 alle 12:21
Risposto: Image Analyst il 26 Giu 2024 alle 3:37
I am writing a program that is just a main script, no GUI (MLAP) or multiple scripts etc. I want to use MATLAB compiler to create the installation executable for the program. However, I do not know how the program will operate once compiled (if anything will work differently/change). The process for me to get my hands on the compiler is long and I have to wait a while every time I want to make a change, so I would like to know how it works beforehand.
In particular I am concerned about the functions: uigetfile, listdlg, uiputfile, questdlg, and fopen. In MATLAB right now, the program displays information the user needs to see to the command window using fprintf. Will this be viewable once compiled? As in, will it maybe run in a terminal and display the info. Also, will it close the terminal as soon as the program finishes so the user cannot read what was displayed? Is there any guides on the compiler?

Risposte (1)

Image Analyst
Image Analyst il 26 Giu 2024 alle 3:37
If you compile the program then anything that would be shown in the command window in the MATLAB development environment will be shown in the console window that opens up alongside your GUI. If you used the -e option then there will be no console window and you won't see anything.
I recommend that if you want to make sure the user sees some information before being presented with some kind of popup dialog box, that you throw up another dialog box before that, like
message = sprintf('Glad you are using my program.\nSelect a folder after you click OK');
uiwait(helpdlg(message));
[baseFileName, folder] = uigetdir(pwd);
See the FAQ for reasons why your compiled app might not run the same as it does in the development environment:
The most common cause is not using fullfile to specify the full path name (folder + base file name + extension).

Categorie

Scopri di più su Application Deployment in Help Center e File Exchange

Prodotti


Release

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by