How to return error code from compiled exe, without throwing up dialogue box?
2 次查看(过去 30 天)
显示 更早的评论
Hi, Matlab community
I need to receive an error code from a Matlab compiled exe. I read that the way to do this is just by throwing an error. However, this also throws up a dialogue box which I do not want to happen:
function error_code = my_function()
class % This results in error
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/703912/image.png)
On the other hand, just returning a value is not interpreted as an error code by the system:
function error_code = my_function()
try
class
error_code = 0;
catch
error_code = 1;
end
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/703917/image.png)
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!