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;

采纳的回答

DGM
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 CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by