Change all elements in 2nd column to 3

vArr = [ 5 5 5 5; 5 5 5 5 ; 5 5 5 5; 5 5 5 5; 5 5 5 5 ]
so i have this and i knw how to change one element but how to change whole colum??
i tired this vArr( :, 3 ) - 2 but then only shows one column

1 Comment

vArr(:,3) is the 3rd column. vArr(:,2) is the 2nd column. Etc.

Sign in to comment.

Answers (1)

James Tursa
James Tursa on 27 Sep 2019
Edited: James Tursa on 27 Sep 2019
vArr(:,2) = _____; % <-- you fill in the blank

6 Comments

not working
What did you fill in the blank with? What does your current code look like?
need to change 2nd column to 3s
vArr( 1:end,3)-2
but it wont show to all just
one column
Why are you using the minus operator - instead of the assignment operator = as I show? Why are you indexing into the 3rd column instead of the 2nd column?
because im seeing what i can do and you are not helping stop answering my questions if you are not goin to help, DO NOT ANSWER MY QUESTIONS ANYMORE
Wow ... uh ... OK, no more answers from me ...

Sign in to comment.

Categories

Find more on Aerospace Blockset in Help Center and File Exchange

Tags

Asked:

on 27 Sep 2019

Commented:

on 27 Sep 2019

Community Treasure Hunt

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

Start Hunting!