how to remove values below 0.1?

조회 수: 2 (최근 30일)
ELISABETTA BILLOTTA
ELISABETTA BILLOTTA 2022년 6월 23일
댓글: Chunru 2022년 6월 24일
after doing a series of calculations I obtained a prob(i)=1x27331 double matrix characterized by values ranging from 0 to about 0.4.
How can I remove all points with values less than 0.1 and change them to NaN?
I need these values below 0.1 to become worthless so that when plotting them they are not marked.
i tried with :
old = lt(prob(i),0.1);
new = NaN;
prob(i) = changem(prob(i),new,old);
...but it doesn't work.
Can anyone help me?
thanksss

채택된 답변

KSSV
KSSV 2022년 6월 23일
If P is your array if size 1x27331.
P(P<0.1) = NaN ;
  댓글 수: 3
KSSV
KSSV 2022년 6월 23일
Do you have a vector or a matrix?
It should not show error, Show us your data.
ELISABETTA BILLOTTA
ELISABETTA BILLOTTA 2022년 6월 23일
ok it works!!! thanks a lot

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

추가 답변 (1개)

Chunru
Chunru 2022년 6월 23일
a = 0.4*rand(100,1); % generate some data
a(a<0.1) = nan
a = 100×1
0.1696 0.3018 0.1866 0.2110 NaN 0.3823 0.1434 0.3446 0.3606 0.3845
  댓글 수: 2
ELISABETTA BILLOTTA
ELISABETTA BILLOTTA 2022년 6월 23일
it gives me an error .. it creates me a matrix made only of values = NaN and also deletes all the values greater than 0.1 that I need to make the graph with countourf
Chunru
Chunru 2022년 6월 24일
Are you sure you use the same code?

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

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by