For example, i have a matrix a = [0 1 2 3 4]. How do I subtract each column by 1?
a = [0 3 2 6 4] b = [0 2 1 2 3] remainder = size(a, 2) - sum(b)
The remainder is -3. I need to minus from b when b(i) ~= 0 so that at the end the b = [0 1 0 1 3].
Thank you.
Best Answer