How to calculate in a matrix

2 Ansichten (letzte 30 Tage)
min wong
min wong am 29 Nov. 2016
Kommentiert: Laith Mohammed am 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

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by