i have a 10*10 matrix.
How to replace the minimum value from each column with nans.
ex; [10,5
2,8
8,1];
the desired out put should be like
[10,5
nan,8
8,nan];
thanks

 채택된 답변

madhan ravi
madhan ravi 2019년 3월 18일
편집: madhan ravi 2019년 3월 18일

0 개 추천

M(M==min(M))=nan % where M is your matrix

댓글 수: 4

My matrix is 3*10 double
it shows Error using ==
Matrix dimensions must agree.
and plz include this condition in code
condition is if the value in each column is not more than 15% of maximum value of that column
madhan ravi
madhan ravi 2019년 3월 18일
편집: madhan ravi 2019년 3월 18일
"Replace minimum value of each column with nan"
M(bsxfun(@eq,M,min(M)))=nan
thanks a lot it works.......
and just one more query. plz help me on this
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];

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

추가 답변 (0개)

카테고리

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

질문:

2019년 3월 18일

댓글:

2019년 3월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by