MATLAB Answers

Compare and select values from an matrix.

1 view (last 30 days)
Hi. Good day.
I have an A matrix of 6 X 4.
I have to compare element by element between row 1 and 2 and select the lower or equal value of this row comparison, then the same will be done with row 3 and 4, finally 5 and 6
A=[ 8 8 8 8
6 5 8 1
6 6 6 6
4 3 2 5
9 9 9 9
6 9 4 3];
The result of this will be a matrix like the one shown:
6 5 8 1
4 3 2 5
6 9 4 3
Thank you

  0 Comments

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 19 Jan 2020
min(A(1:2:end,:), A(2:2:end, :))

  1 Comment

Sign in to comment.

More Answers (0)

Sign in to answer this question.


Translated by