Compare and select values from an matrix.

3 ビュー (過去 30 日間)
Ricardo Gutierrez
Ricardo Gutierrez 2020 年 1 月 19 日
コメント済み: Ricardo Gutierrez 2020 年 1 月 19 日
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

採用された回答

Walter Roberson
Walter Roberson 2020 年 1 月 19 日
min(A(1:2:end,:), A(2:2:end, :))
  1 件のコメント
Ricardo Gutierrez
Ricardo Gutierrez 2020 年 1 月 19 日
Thank you.
It worked !!!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

製品


リリース

R2015a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by