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

1 次查看(过去 30 天)
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..

回答(1 个)

Adam
Adam 2015-12-4
编辑:Adam 2015-12-4
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).

类别

Help CenterFile Exchange 中查找有关 MATLAB Compiler 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by