Effacer les filtres
Effacer les filtres

Assign values to a matrix from a 2 dimensional array....

1 vue (au cours des 30 derniers jours)
Piyum Rangana
Piyum Rangana le 2 Avr 2017
Réponse apportée : dpb le 2 Avr 2017
Think I have a 2-dimensional array(Assume that x and y co-ordinations). And I want to assign '1' to all those co-ordinations given in the array(If the matrix values all are Zeros). How to do that Task ?

Réponse acceptée

dpb
dpb le 2 Avr 2017
a(a==0)=1; % done!
Look up "matrix addressing" in documentation

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays 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!

Translated by