How to get a one function result?
古いコメントを表示
I have a main function called mainfun
function [out1,out2]=mainfun(input)
[out1]=fun1(input);
[out2]=fun2(input);
end
so my question is ,may be i am calling my mainfun,and I want to display the individual result from different sub function,but how to display if there is any error in one subfunction ?
like an example ,
if in my fun1 there is eroor then also i want to get the fun2 result .
採用された回答
その他の回答 (1 件)
David Hill
2022 年 5 月 6 日
function [out1,out2]=mainfun(input)
out1=nan;out2=nan;
try [out1]=fun1(input);
end
try [out2]=fun2(input);
end
2 件のコメント
Akash Pal
2022 年 5 月 9 日
Walter Roberson
2022 年 5 月 9 日
You should initialize any output variable that might otherwise not be assigned to because of errors.
カテゴリ
ヘルプ センター および File Exchange で Image Arithmetic についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!