Hello,
I currently have a set of about 200 2 by 200 matrices (can be split into 400 1 by 200 if it is easier). I need to remove some values that are over a maximum value.
For example, most of the values range from 1 to 200, but there is one point with a value of 600, how do I remove the 600?
Each matrix can have 1,2 or 3 values over the maximum, therefore I need to set a limit.
I appreciate this is probably a very simple issue for you guys.
Cheers
EDIT: Yer,I want to remove these points. Using this way works, when the point is above the x and y co-ord:
Suppose your matrix is called "M1", and your maximal value is MAXVAL,
M1(M1>MAXVAL)=[ ]; %to remove
M1(M1>MAXVAL)=-1; %to replace it with a value
However some of the points are inside the Y limit but outside the X limit.
Is there a way to set a limit for the first column (X) and remove the correspond co-ord on the same row in the second column (Y).
Remembering that there maybe more then 1 row to delete in each matrix.
Sorry if this confuses.

 채택된 답변

Dev-iL
Dev-iL 2012년 3월 7일

0 개 추천

What do you want to do with the 600? Delete it (making the vector shorter)? replace it with a different number? replace it with a char?
Suppose your matrix is called "M1", and your maximal value is MAXVAL,
M1(M1>MAXVAL)=[ ]; %to remove
M1(M1>MAXVAL)=-1; %to replace it with a value

추가 답변 (1개)

Christian Noack
Christian Noack 2015년 10월 12일

0 개 추천

I got a similar question. I also have a matriz which is [1000 5] so, in each column I want to put a limit, so if the number in [i,k] surpass the limit in column k, then it replace the number as the limit. Which is the efective way to do something like that?

카테고리

도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2012년 3월 7일

답변:

2015년 10월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by