Add 3 to just the odd-index elements
I am using this help-yourself
http://www.facstaff.bucknell.edu/maneval/help211/exercises.html
And have a question regarding
2. Let x = [2 5 1 6].
b. Add 3 to just the odd-index elements
They give the answer as
b = x(1:2:end) + 3
but that makes a new matrix with just two numbers in it.
Like so:
"b =
21 20
"
Is the question or the answer wrong?I am using this help-yourself
http://www.facstaff.bucknell.edu/maneval/help211/exercises.html
And have a question regarding
2. Let x = [2 5 1 6].
b. Add 3 to just the odd-index elements
They give the answer as
b = x(1:2:end) + 3
but that makes a new matrix with just two numbers in it.
Like so:
"b =
21 20
"
Is the question or the answer wrong? I am using this help-yourself
http://www.facstaff.bucknell.edu/maneval/help211/exercises.html
And have a question regarding
2. Let x = [2 5 1 6].
b. Add 3 to just the odd-index elements
They give the answer as
b = x(1:2:end) + 3
but that makes a new matrix with just two numbers in it.
Like so:
"b =
21 20
"
Is the question or the answer wrong? odd matrix numbers MATLAB Answers — New Questions