필터 지우기
필터 지우기

Selecting points from a matrix

조회 수: 7 (최근 30일)
Jen
Jen 2018년 6월 18일
댓글: Jen 2018년 6월 18일
I'm trying to select certain points from a very large matrix using Matlab that fall in a value range and make the rest of the values zeroed in that matrix. The matrix is about 500x500 and I only want values between 9 and 10 to show and everything else zeroed. Please let me know if this is possible/ if you can help? Thanks!

채택된 답변

Paolo
Paolo 2018년 6월 18일
x = [9,10,3,2,6;3,1,7,8,10];
x =
9 10 3 2 6
3 1 7 8 10
x(x<9 | x>10) = 0;
x =
9 10 0 0 0
0 0 0 0 10
  댓글 수: 1
Jen
Jen 2018년 6월 18일
Thank you, this worked!

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

추가 답변 (1개)

Matt J
Matt J 2018년 6월 18일
편집: Matt J 2018년 6월 18일
If A is your matrix
A( A<9 | A>10)=0 ;

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by