I have a cell matrix containing numeric values and NaN. How can I remove the NaN values and "trim" my matrix.
For example I have the following matrix:
A = { 1, 12, NaN; 1 ,4, NaN; 1 , 2 , NaN ; NaN, NaN, NaN; 1, 2, NaN };
I would like to remove the NaN and resize the matrix to have this matrix. Can it be done without loop ? (using vectorisation)
A = [ 1, 12; 1, 4; 1, 2; 1, 2];