How to calculate in a matrix

3 vues (au cours des 30 derniers jours)
min wong
min wong le 29 Nov 2016
Commenté : Laith Mohammed le 21 Nov 2019
If I had a matrix A=[12 3 65,2 3 6,68 15 40]
I want to change second array of matrix A multiply 10
will be like A=[12 3 65,20 30 60,68 15 40]
How can I do ?
Thank you

Réponse acceptée

KSSV
KSSV le 29 Nov 2016
A=[12 3 65 ;2 3 6 ;68 15 40] ;
iwant = A ;
iwant(:,2) = 10*iwant(:,2) ;
Read about matrix indexing......
  2 commentaires
min wong
min wong le 30 Nov 2016
thank you
Laith Mohammed
Laith Mohammed le 21 Nov 2019
Good answer just reverse iwant(2,:) = 10*iwant(2,:)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices 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