About vector comparasion question.

2 ビュー (過去 30 日間)
C Zeng
C Zeng 2013 年 4 月 2 日
Hi, I know I have asked the similar question, I want to write a if statement that compare vectors, like a, b is 3 dimensional vector, however if a<=b returns a 3-dim vector that do the comparison for each entry.
Is there a command just do a whole comparison at once? Thanks.

採用された回答

Mahdi
Mahdi 2013 年 4 月 2 日
Have you tried using the 'or' operator?
if size(a,2)==3 | size(b,2)==3
...
elseif size(a,1)<=size(b,1)
...
end
Sorry, you weren't very clear, but I hope some of the above will help.
  5 件のコメント
Jan
Jan 2013 年 4 月 2 日
@C Zeng: Flagging is used to tell the admins and editors, that a message violates the using conditions of the forum. Please press the "Accept" button instead of setting a flag. Thanks.
C Zeng
C Zeng 2013 年 4 月 2 日
Sorry about that Jan! Thanks!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFunction Creation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by