How to change values of specific elements inside a matrix?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
darkgod89
le 6 Juin 2016
Modifié(e) : Azzi Abdelmalek
le 6 Juin 2016
I have a 10x10 matrix y. I want to look for all the elements inside y that have a value greater than 100 and divide them by 10. How do I go about this? I was thinking of this if y > 100 y = y./10; end But it doesn't work for someone reason. How can I fix this? Or are there any alternate solutions?
0 commentaires
Réponse acceptée
Azzi Abdelmalek
le 6 Juin 2016
Modifié(e) : Azzi Abdelmalek
le 6 Juin 2016
idx=y>100
y(idx)=y(idx)/10
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Array Geometries and Analysis 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!