Replacing a Column vector value

I have a matrix x=[1 2 3; 4 5 6; 7 8 9]. i wanted to replace 3rd column of matrix by a scalor value of 10. new matrix should look like x=[1 2 10; 4 5 10; 7 8 10]

 Accepted Answer

x(:,3) = 10

1 Comment

sir thank you.. Actually its a small step but i got confused :)

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!