MATLAB: How to assign numbers

assign value to table

Hi all I have got a table where I want to assign number bigger than the highest number already there in the table to the ones assigned zero. How can I do that.

Best Answer

a = [1 2 3 0 4 5 0];
a(~a) = max(a) + (1:nnz(~a))