Question: Task #5: Update the vector piRange to swap the first and last elements. Task #6: Save the values at indexes 2, 4, 1, 7 and

Task #5: Update the vector piRange to swap the first and last elements.

Task #6: Save the values at indexes 2, 4, 1, 7 and 8 in that order, from the vector piRange above to a new vector called outOfOrder. Use vector-indexing to access those values.

Task #7: Using the linspace function, generate a vector named linspace7 with the same values that result from this colon notation expression ( 2 : 0.5 : 10 )

Task #8: Uncomment the code that you see below. Try running the script again to see the error that occurs. You see this error because the second line of code is attempting to access the value at index ten of the vector task8Vector. This vector only has 3 elements, therefore index ten is out of bounds and causes an error. Update the code below to instead extend this vector by setting the value at index ten to 8.5. We talked about using an out-of-bounds element assignment to extend a vector in class. %task8Vector = [ 3 4 5 ] %task8Vector(10)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!