How to calculate in a matrix

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

A=[12 3 65 ;2 3 6 ;68 15 40] ;
iwant = A ;
iwant(:,2) = 10*iwant(:,2) ;
Read about matrix indexing......

2 Comments

thank you
Good answer just reverse iwant(2,:) = 10*iwant(2,:)

Sign in to comment.

More Answers (0)

Categories

Asked:

on 29 Nov 2016

Commented:

on 21 Nov 2019

Community Treasure Hunt

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

Start Hunting!