What does a(a<0) = 0 mean in matlab?
Mostrar comentarios más antiguos
I am new to matlab.
What does a(a<0) = 0 mean?
is it valid if a is an array as well?
Respuesta aceptada
Más respuestas (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
Categorías
Más información sobre Matrices and Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!