How to calculate in a matrix

2 views (last 30 days)
min wong
min wong on 29 Nov 2016
Commented: Laith Mohammed on 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

Accepted Answer

KSSV
KSSV on 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 Comments
Laith Mohammed
Laith Mohammed on 21 Nov 2019
Good answer just reverse iwant(2,:) = 10*iwant(2,:)

Sign in to comment.

More Answers (0)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!