Change all elements in 2nd column to 3
Afficher commentaires plus anciens
vArr = [ 5 5 5 5; 5 5 5 5 ; 5 5 5 5; 5 5 5 5; 5 5 5 5 ]
so i have this and i knw how to change one element but how to change whole colum??
i tired this vArr( :, 3 ) - 2 but then only shows one column
1 commentaire
James Tursa
le 27 Sep 2019
vArr(:,3) is the 3rd column. vArr(:,2) is the 2nd column. Etc.
Réponses (1)
James Tursa
le 27 Sep 2019
Modifié(e) : James Tursa
le 27 Sep 2019
vArr(:,2) = _____; % <-- you fill in the blank
6 commentaires
nty huy
le 27 Sep 2019
James Tursa
le 27 Sep 2019
What did you fill in the blank with? What does your current code look like?
nty huy
le 27 Sep 2019
James Tursa
le 27 Sep 2019
Why are you using the minus operator - instead of the assignment operator = as I show? Why are you indexing into the 3rd column instead of the 2nd column?
nty huy
le 27 Sep 2019
James Tursa
le 27 Sep 2019
Wow ... uh ... OK, no more answers from me ...
Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!