필터 지우기
필터 지우기

how to cut the matrix

조회 수: 1 (최근 30일)
Quynh tran
Quynh tran 2017년 5월 11일
댓글: Quynh tran 2017년 5월 11일
Dear all, I have a matrix like this:
[1 0.1
2 0.2
3 0.3
4 0.5
5 0.6
6 1.2
7 1.2
8 1.3]
I want to cut the matrix part which is less than 1.2
It means that the result is:
[1 0.1
2 0.2
3 0.3
4 0.5
5 0.6]
Could you help me to write code for this. Thanks.

채택된 답변

James Tursa
James Tursa 2017년 5월 11일
x = [1 0.1
2 0.2
3 0.3
4 0.5
5 0.6
6 1.2
7 1.2
8 1.3];
>> y = x(x(:,2)<1.2,:)
y =
1.0000 0.1000
2.0000 0.2000
3.0000 0.3000
4.0000 0.5000
5.0000 0.6000
  댓글 수: 1
Quynh tran
Quynh tran 2017년 5월 11일
Thank you so much

댓글을 달려면 로그인하십시오.

추가 답변 (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