Borrar filtros
Borrar filtros

How does a MATLAB compiled script represent the command window?

26 visualizaciones (últimos 30 días)
Kealan
Kealan el 25 de Jun. de 2024 a las 12:21
Respondida: Image Analyst el 26 de Jun. de 2024 a las 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?

Respuestas (1)

Image Analyst
Image Analyst el 26 de Jun. de 2024 a las 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).

Categorías

Más información sobre Application Deployment en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by