Replace a value if a condition is met
90 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Danny Helwegen
le 25 Nov 2018
Commenté : Akira Agata
le 25 Nov 2018
Hi, I got a little problem and I hoped someone can help me out.
When I have a matrix consisting of 3 columns, I want to replace a value in the third column if a row in the first column has a certain value. For example, I have the following matrix:
A =
3 6 9
2 6 8
3 6 8
Lets call the first column x, the second y and the third z. Now what I want is that when x == 3, than z must become 20.
How can I do this?
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Introduction to Installation and Licensing 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!