Suppressing only part of a function output?
16 次查看(过去 30 天)
显示 更早的评论
If I were to have a function in the form [a,b,c] = myFun(d,e), and I wanted to call the function in a script and have all three output values, (a,b,c) in the workspace, but only a and b printed to the command window how could i accomplish that?
Thanks for any help.
0 个评论
回答(1 个)
Star Strider
2020-4-4
To have only ‘a’ and ‘b’ returned:
[a,b] = myFun(d,e)
and to have only ‘c’ returned:
[~,~,c] = myFun(d,e)
Use variations on this idea to return whatever outputs you want.
This is described in: Ignore Function Outputs
2 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!