How to calculate in a matrix

2 visualizzazioni (ultimi 30 giorni)
min wong
min wong il 29 Nov 2016
Commentato: Laith Mohammed il 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

Risposta accettata

KSSV
KSSV il 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 Commenti
min wong
min wong il 30 Nov 2016
thank you
Laith Mohammed
Laith Mohammed il 21 Nov 2019
Good answer just reverse iwant(2,:) = 10*iwant(2,:)

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Matrices and Arrays in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by