What does a(a<0) = 0 mean in matlab?
Afficher commentaires plus anciens
I am new to matlab.
What does a(a<0) = 0 mean?
is it valid if a is an array as well?
Réponse acceptée
Plus de réponses (1)
> What does a(a<0) = 0 mean?
a can be a scalar or an array.
This replaces all values in a that are less than 0 with 0.
Example
a = [-6: 2 : 6]
a(a<0) = 0
Catégories
En savoir plus sur Matrices and Arrays dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!