Function Output selection help?

7 ビュー (過去 30 日間)
Steve
Steve 2011 年 10 月 8 日
Hello Experts,
I have a function func. I know that func can give me [output1,output2] and by default gives me the output1.
How can I customize it and ask Matlab to give me the second output.
I will appreciate if you will give me the way to toggle between the outputs.
Thanks in advance.

採用された回答

Wayne King
Wayne King 2011 年 10 月 8 日
If you define the function to give [output1,output2], then you can call the function
[~,output2] = func( )
and it will not output output1
  5 件のコメント
Jan
Jan 2011 年 10 月 8 日
~ is either the not-operator, or in the case of inputs and outputs the command to ignore the argument.
This method does not work with Matlab versions before 2009b.
You've asked several very basic questions in the last 10 days. I suggest to read the Getting Started chapters in the documentation. If Google can answer a question, it is not efficient to ask in this forum
This forum is very mindful and you can be sure that your blog has been registered already.
Walter Roberson
Walter Roberson 2011 年 10 月 8 日
The technical name of "~" is "tilde". But of course, a pedant would point out that "~" as used in MATLAB is not correct, and that one should instead use "∼" (U+223C) TILDE OPERATOR, for logical negation, and possibly "⁓" (U+2053) SWUNG DASH, for indicating omission. And if you can tell the difference between those characters, you have better eyes than I do!
http://en.wikipedia.org/wiki/Tilde

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by