Collect only non-zero elements of a 3x3xN matrix
Show older comments
Hi,
I've a symbolic 3x3xN (with N variable) matrix I with some non-zero elements, like:
I(:,:,1) =
[ 0, 0, 0]
[ 0, 0, 0]
[ 0, 0, Il1]
I(:,:,2) =
[ 0, 0, 0]
[ 0, 0, 0]
[ 0, 0, Il2]
and I want to collect them into an array, but when I try:
[m,v]=find(I~=0)
it returns indices like m=3 v=9. How can I find them from the 3-D matrix and collect them into an array ?
Accepted Answer
More Answers (1)
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!