Question: Write a MATLAB program that uses the input function to prompt the user for an array of 4 values (warn the user to enter the

 Write a MATLAB program that uses the input function to prompt

Write a MATLAB program that uses the input function to prompt the user for an array of 4 values (warn the user to enter the numbers as an array) and store them in an array variable. Use a loop to fill a new array with the values from the first array in reverse order. Print the new array. Use a single line that refers to the input array with 4 indices to create a new array with the values from the first array in reverse order. Print the new array. We want to be able to create two sets of values from a loop value. For this example, we want to use MATLAB to create indices that would be useful in printing an array, of 16 values, 4 at a time. We will try these two ways. Write a for loop that runs from 1 to 4. Inside the loop determine an expression that will transform the loop variable into two variables, starting index and an ending index, whose values are as follows Print out the values of the starting and ending indices within the loop. b. Write a for loop that runs from 1 to 16 with increments of 4. Again, inside the loop determine an expression that will transform the loop variable into two variables, starting index and an ending index, whose values are as the same as they were in 2a. Print out the values of the starting and ending indices within the loop

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!