Hello; Given a vector B = [ 8 3 9 4 6 7 7 5 4 5]; How do I call out from B all the even element locations? (Not even numbers, locations)
1 view (last 30 days)
Show older comments
Hello; Given a vector B = [ 8 3 9 4 6 7 7 5 4 5]; How do I call out from B all the even element locations? (Not even numbers, locations)
0 Comments
Accepted Answer
James Tursa
on 4 Mar 2015
Edited: James Tursa
on 4 Mar 2015
% B(2:2:end) % NO
EDIT:
find(mod(B,2)==0)
3 Comments
James Tursa
on 4 Mar 2015
Edited: James Tursa
on 4 Mar 2015
Sorry ... I misread your intent. Answer edited.
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!