How to creat functions that return >1 Variables
5 ビュー (過去 30 日間)
古いコメントを表示
This may be a dumb question, but I'm having problems on creating functions that return more than 1 value. Let me give you an example:
function [addi, subt]= addsub(a,b)
%Addiert und Subtrahiert zwei Werte a, b. addsub(a,b)
c=a+b;
d=a-b;
addi=c;
subt=d;
end
If I call the function from the command window with: addsub(9,10) It returns ans=19 . So my question is, how can i tell matlab to return 19 and -1 ?
Thanks in Advance Sebastian
0 件のコメント
採用された回答
Sebastian
2011 年 2 月 7 日
1 件のコメント
Walter Roberson
2011 年 2 月 7 日
Accept your own answer. It won't close the thread but it will show it as being "solved".
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!