possible to use logical indexing with an array argument ?

1 回表示 (過去 30 日間)
RuiQi
RuiQi 2017 年 1 月 17 日
コメント済み: John Chilleri 2017 年 1 月 18 日
is there a way I can convert this code
for i=1:15653
label == i
end
to a vectorized one ?
i=1:15653;
label == i
  1 件のコメント
Stephen23
Stephen23 2017 年 1 月 17 日
編集済み: Stephen23 2017 年 1 月 17 日
What is wrong with
i=1:15653;
label == i
?
What do you want to do with this?

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

採用された回答

John Chilleri
John Chilleri 2017 年 1 月 17 日
編集済み: John Chilleri 2017 年 1 月 17 日
Hello,
WhateverYouWant = (label == 1:15653);
Note: assuming label is also a 15653 length vector OR a scalar.
Hope this helps!
  2 件のコメント
RuiQi
RuiQi 2017 年 1 月 18 日
Sorry I was sure it didnt work when I typed
la
label == i
earlier on
John Chilleri
John Chilleri 2017 年 1 月 18 日
No worries! Glad I could help!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by