how to obtain the id of change in vector
1 view (last 30 days)
Show older comments
i have a vector say
v =[ 0 0 0 0 28 34 0 56 67 0 0 0 69 71 75 89 90 0]
I need to find what are the ids where there is change in value from 0 to some number or from some number to 0. So in this case the ids should be like 5 6 8 9 13 17
Is there a smart way to do it?
0 Comments
Answers (2)
See Also
Categories
Find more on Logical 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!