How to set all elements of a matrix that meet a certain criteria to NaN?

조회 수: 4 (최근 30일)
I have a Matrix A with the size of [200 100 20 60]. How do I set all elements larger than 10^20 as NaN?

채택된 답변

Star Strider
Star Strider 2018년 3월 14일
Try this:
A(A > 1E+20) = NaN;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by