Effacer les filtres
Effacer les filtres

How to replace values less than ...

19 vues (au cours des 30 derniers jours)
laith awwad
laith awwad le 21 Avr 2021
Commenté : laith awwad le 24 Avr 2021
HOW TO NAME THE VARIABLE BECAUSE IF I WRIGHT IT GIVES ME AN ERROR FOR EXAMPLE e =matrix (matrix<=0)= NaN;

Réponse acceptée

DGM
DGM le 21 Avr 2021
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.
  1 commentaire
laith awwad
laith awwad le 24 Avr 2021
Thank you it worked

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by