Return the output of an eval function
6 views (last 30 days)
Show older comments
I am trying to read the status of an external program that I call from a matlab function. The program is called testConn.exe. I call the program like this:
commandSTR = ['!testConn upload ' ipAddress ' testLink];
eval(commandStr);
when I run the function everything works and I see a status message from testConn in the command window with a status message like:
exit status 0 (No errors)
or
exit status 8 (No connection)
My question is how do I capture those status returns so that I can use them for error control? I should add that when I try something like
a = eval(commadSTR);
I get an error from matlab saying unexpected matlab operator; Is there an alternative to the eval function?
Thanks,
Jesse
0 Comments
Answers (1)
Geoff Hayes
on 13 Oct 2015
status = system(commandSTR);
which may capture the exit status of the command.
1 Comment
See Also
Categories
Find more on Software Development Tools in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!