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

1 view (last 30 days)
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..

Answers (1)

Adam
Adam on 4 Dec 2015
Edited: Adam on 4 Dec 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).

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!