How to delete zero components in a vector in Matlab?
- by xiaodai
I have a vector for example
a = [0 1 0 3]
I want to turn a into b which equals b = [1 3]
How do I perform this in general? So I have a vector with some zero components and I want to remove the zeroes and leave just the non-zero numbers.
Sorry I am new to Matlab