How to replace values less than equal to zero values in a matrix?

I have a marix of 44450*8 dimention, which contain some zero and negative values, I want to replace them with NaN. how to do that?

 採用された回答

Adam
Adam 2018 年 11 月 14 日

4 投票

myMatrix( myMatrix <= 0 ) = NaN

その他の回答 (1 件)

Sai Naga Raju
Sai Naga Raju 2021 年 1 月 3 日

0 投票

matrix (matrix<=0)= NaN

1 件のコメント

laith awwad
laith awwad 2021 年 4 月 21 日
編集済み: laith awwad 2021 年 4 月 21 日
HOW TO NAME THE VARIABLE BECAUSE IF I WRIGHT IT GIVES ME AN ERROR FOR EXAMPLE e =matrix (matrix<=0)= NaN;

サインインしてコメントする。

製品

タグ

質問済み:

2018 年 11 月 14 日

編集済み:

2021 年 4 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by