Question: PLEASE help by using MATLAB and explain Function Name: shiftRight Inputs: 1. a vector 2. shift number Output: 1. modified vector Description: 1. Write a

PLEASE help by using MATLAB and explain

PLEASE help by using MATLAB and explain Function Name: shiftRight Inputs: 1.

Function Name: shiftRight Inputs: 1. a vector 2. shift number Output: 1. modified vector Description: 1. Write a function called shiftRight that takes in a vector and a shift number and takes the vector and shifts the numbers to the right based on the value specified by the 2nd input. Numbers should "wrap around the vector when shifted to the right. Ex: shiftRight([1 2 3 4 5 6], 2) [5 6 1 2 3 4]. It is guaranteed that the shift number will be in between 1 and the length(vec) - 1. You are not allowed to use the circshift function. Examples: ans1 = shiftRight([5 8 2 0 10],4) %ans1 = [8 2 0 10 5] an2 = shiftRight([10 9 8],1) %ans2 = [8 10 9] ans3 = shiftRight([2 3 3 2],2) %ans 3 = [3 2 2 3]

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!