How to replace values less than ...
조회 수: 19 (최근 30일)
이전 댓글 표시
HOW TO NAME THE VARIABLE BECAUSE IF I WRIGHT IT GIVES ME AN ERROR FOR EXAMPLE e =matrix (matrix<=0)= NaN;
댓글 수: 0
채택된 답변
DGM
2021년 4월 21일
Assuming you have a matrix A and you want to make a copy B which has all nonpositive content replaced with NaN
A=randn(100);
B=A; % make a copy
B(B<=0)=NaN; % replace the values
Trying to do something like
B=A(A<=0)=NaN;
isn't going to work.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!