Comparing my array to two variables
Mostrar comentarios más antiguos
Hello
I'm trying to compare my array values ( numerical ) to two variables. For example i would like any number in my array greater than 2 to be rounded to two, and any number less than 0 rounded to 0. I can't seem to find a simple expression to do this. So i would like to compare all numbers in the array to those two conditions and then round them to their respective closest number. How do i possible go about this?
1 comentario
Image Analyst
el 25 de Ag. de 2020
Original question in case he deletes is like he's done with other posts:
Hello
I'm trying to compare my array values ( numerical ) to two variables. For example i would like any number in my array greater than 2 to be rounded to two, and any number less than 0 rounded to 0. I can't seem to find a simple expression to do this. So i would like to compare all numbers in the array to those two conditions and then round them to their respective closest number. How do i possible go about this?
Respuesta aceptada
Más respuestas (1)
Categorías
Más información sobre Logical 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!