Choose rows that the first column is larger than the second column

조회 수: 2 (최근 30일)
I have an n*2 matrix A. I only want to have rows that the first column is larger than the second column. What is a simple way to do this?
For example, suppose I have
A = [ 2 1;3 4]
I just want to keep the first row.

채택된 답변

Walter Roberson
Walter Roberson 2020년 8월 3일
A(A(:,1)>A(:,2),:)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by