hallo,
I can find only two max with this code. can you help me please to find all Max (more than 1 or 2) with the corrent code in this Matrix X=[1,2,3;7,1,9;4,9,6;9,8,7].
X=[1,2,3;7,1,9;4,9,6;9,8,7];Max = -Inf;row = 0;column = 0;row1 = 0;column1 = 0;for i = 1:size(X, 1) for j = 1:size(X, 2) if X(i, j) > Max Max = X(i, j); row = i; column = j; end if X(i, j) >= Max Max = X(i, j); row1 = i; column1 = j; end endendXMaxrowcolumnrow1column1
Best Answer