Update matrix using vector of column index
Afficher commentaires plus anciens
I have a 2-dim matrix like this:
0.3436 0.3283 0.3890 0.0274
0.1137 0.4443 0.3484 0.0889
0.2748 0.3124 0.4074 0.0439
and a vector with column indexes for each row
3
2
2
Task is to invert values to get result like this:
0.3436 0.3283 -0.3890 0.0274
0.1137 -0.4443 0.3484 0.0889
0.2748 -0.3124 0.4074 0.0439
I believe there is a simple way to do that efficiently without for-loop cycles. Any idea?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Parallel Computing dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!