Multi output function as input
6 ビュー (過去 30 日間)
古いコメントを表示
Hi, I have a function test that has four input. Than I have another one function daisy that has three outputs. How may I do something like
>>test(dasy,X);
where the outputs of daisy is correct as first three input of test and X is a correct input as last input of test? I tried but it doesn't work and say that I didn't pass the third input argument (I think because daisy pass only his first output to test...).
thank you everyone.
0 件のコメント
回答 (1 件)
Walter Roberson
2011 年 12 月 15 日
In MATLAB, it cannot be done in one step. You must assign the output of daisy to one or three variables.
[d1, d2, d3] = daisy();
test(d1, d2, d3, X)
OR
[d{1:3}] = daisy();
test(d{:}, X)
2 件のコメント
Walter Roberson
2011 年 12 月 16 日
Right there isn't any way. Of course you can clear the temporary variable right after you use it.
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!