Matlab. Could you please answer question 5 with explaination. Thanks. B https://
ID: 3910861 • Letter: M
Question
Matlab. Could you please answer question 5 with explaination. Thanks.
B https://cas-ecampus.wvu.edu/webap https://cas-ecampus. wwu.edu/webapps/assessment/review/review.jsplattempt id- 24623362 18couse id- 101834,18content id- 4881489,1outco Question 4 0.5 out of 5 points Write a MATLAB function to shift array contents 1 position to the right and replace the one-dimensional arrays with any number of elements. Both the input array and then output array should be named named rightShift first element with a value of-1 (negative one). The code must work for The function should be Ex [10,20.30,40] after shifting becomes (10,10.20,30] and the replacement makes the result (-1,10.20.301 (This is an example for your understanding of the process. Your code must work for any 1D array, not just this one) Selected Answer function measurements measurements (x.y) measurements 112] measurements (1)-1 Correct Answer function measurements rightShift(measurements) measurements(2 end)-measurements(1 end-1 samplereadings(1)-1 end Response Feedback partially correct function definition line +05 2 out of 3 points Question 5 Evaluate the following script file, and write the output in the space provided: h-[2.2:8] m-h(2)+4 n-max(h) fprintf('m is %, 1 fm) Selected Answer 3 m is 8 Correct Answer Case Sensitivity Correct Answer Evaluation Method m is 8.0 10:45 PM Exact Match ENG snExplanation / Answer
h = [2:2:8]; -> so, h is [2 4 6 8] and h(2) is 4 m = h(2)+4; n = max(h); fprintf('m is %.1f', m) => m = h(2) + 4; h(2) is 4 => m = 4 + 4 => m = 8 %.1f prints m with one digit after decimal place so, answer would be 'm is 8.0'