MATLAB: Hello Everyone, I’m looking for your help for the following problem

max

Use the matrix given on the first link.I need a matlab code that can generate on the second link. Thanks!

Best Answer

The second image you uploaded is not the correct maximum value array for each column... Anyway, let me try to do this without using for-loop:
A = [17 14 18 15 14 19;...
1 5 3 30 8 14;...
20 2 16 7 13 11];
idx = bsxfun(@eq,A,max(A));
A(~idx) = NaN;
The result is:
>> A
A =
NaN 14 18 NaN 14 19
NaN NaN NaN 30 NaN NaN
20 NaN NaN NaN NaN NaN