I have column vectors A and B:
A'= [1 2 0 0 1 4]
B'= [1 2 3 4 5 6]
I would like to filter out the zeros in A and remove corresponding elements in B and have them as:
A' = [1 2 1 4]
B' = [1 2 5 6]
I know there is a quick MATLAB command to do this, but cant figure it out.
The quickest, easiest way is by using logical indexing:
Another way is the slightly slower