possible to use logical indexing with an array argument ?

1 view (last 30 days)
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 Comment
Stephen23
Stephen23 on 17 Jan 2017
Edited: Stephen23 on 17 Jan 2017
What is wrong with
i=1:15653;
label == i
?
What do you want to do with this?

Sign in to comment.

Accepted Answer

John Chilleri
John Chilleri on 17 Jan 2017
Edited: John Chilleri on 17 Jan 2017
Hello,
WhateverYouWant = (label == 1:15653);
Note: assuming label is also a 15653 length vector OR a scalar.
Hope this helps!

More Answers (0)

Community Treasure Hunt

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

Start Hunting!