How to do this process
A=[10,0.5
1,8
8,0];
A_max =max(A);
out=[10,8];
i want to replace values <15%A_max with nans
output matrix
Out=[10,nan %0.5 is less than the 15%8
nan,8 % 1 is <15%10
8,nan];

 채택된 답변

madhan ravi
madhan ravi 2019년 3월 18일

0 개 추천

Out = A;
Out(A < (max(A)/100)*15)=nan

댓글 수: 3

Leela Sai Krishna
Leela Sai Krishna 2019년 3월 18일
Thanks a lot @Madhan ravi sir
your responses are too helpful for me
Leela Sai Krishna
Leela Sai Krishna 2019년 3월 19일
It showing
Error using <
Matrix dimensions must agree.
How to rectify this error
madhan ravi
madhan ravi 2019년 3월 20일
편집: madhan ravi 2019년 3월 20일

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

추가 답변 (1개)

Fangjun Jiang
Fangjun Jiang 2019년 3월 18일

0 개 추천

A(A<0.15*A_max)=nan

댓글 수: 2

Leela Sai Krishna
Leela Sai Krishna 2019년 3월 18일
its working, Thanks a lot
Asliddin Komilov
Asliddin Komilov 2020년 1월 17일
I have set of 25 variables (matrices), can I have repliced all zero value to NAN in all of the at once, without doing it for each of them separately?
thanks

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by