Replace Values Larger than Threshold with New Value, But Keep Smaller Values
73 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Michelle De Luna
le 28 Jan 2021
Commenté : Michelle De Luna
le 28 Jan 2021
Hi all,
I have a 600 x 2 matrix, and I would like to check which values within the first column exceed a threshold. For example, I would like to replace all values that exceed 180 with that number minus 250 (e.g. 270 would be replaced with 20 because 270 - 250 equals 20). However, I would like to keep the values that are below 180 the same. In essence, I'm trying to keep the original order established by the original matrix, but I just need to replace those values greater than 180 with new values. Any hints? (This should be really easy, and I'm sure I'll find a solution eventually, but right now my stress isn't helping me see clearly.)
Thanks in advance!
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!