index position of the 1
Show older comments
Hi,
I have the following cell array
TEST = [1] [] [] [0] []
I want to get the index position of the 1 not the 0. thanks :) !
Accepted Answer
More Answers (2)
KSSV
on 7 Nov 2016
TEST = {[1] [] [] [0] []} ;
% index position of 1
idx = find([TEST{:}] == 1)
1 Comment
Walter Roberson
on 7 Nov 2016
If you switch to
TEST = {[0] [] [] [1] []} ;
then [TEST{:}] would be [0 1] and you would return an index of 2, but the actual index should be 4.
khaled hassan
on 7 Nov 2016
0 votes
Categories
Find more on Data Types in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!