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