Borrar filtros
Borrar filtros

How to display error messages in Matlab Runtime (compiled) version

2 visualizaciones (últimos 30 días)
Fotis
Fotis el 4 de Dic. de 2015
Comentada: Fotis el 4 de Dic. de 2015
Hi all
I have made a matlab program that uses an Input file where all input parameters are defined. I have programed it such that if the parameters are out of range, then matalb gives me an error with a message that I have written. I use the
if then else command and the error command.
Now, I am compiling this program to run it as 'Runtime' executable version. I use a txt file to define my inputs now. How can I make the Runtime version also display error messages when a parameter is out of range? If I use the same code as the original version, I simply don't get anything.. as a result..

Respuestas (1)

Adam
Adam el 4 de Dic. de 2015
Editada: Adam el 4 de Dic. de 2015
Either use
errordlg
if you want the message to be displayed to the user or if you make sure that your executable creates a log file (it is an option towards the bottom of the compiler UI) into which the error messages that would otherwise be printed to command line will be shown. This will only warn you with a sound though when it happens so is not ideal if you expect this to be a part of the general workflow of your tool. In that case, if the user is expected to respond then errordlg is the way (or create your own UI to popup if you want something more in-depth than what errordlg offers).

Categorías

Más información sobre Scope Variables and Generate Names 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!

Translated by