Question: MATLAB HELP!!!! JOINING ARRAYS - MatLab Consider the following rectangular array mat : mat = [1 2 3; 4 5 6; 7 8 9] A)

MATLAB HELP!!!!

JOINING ARRAYS - MatLab

Consider the following rectangular array mat:

mat = [1 2 3; 4 5 6; 7 8 9]

A) Write a command to return a rectangular array that is equal to mat except the last column of mat appears as the first and last column of the new array. Thus, the new array has four columns, and its second, third, and fourth columns are equal to the columns of mat. In your command, do not type specific elements of mat but commands to take a subarray and join it to mat.

B) Give the command to return the last row. Thus, the returned vector is [7 8 9].

C) Write a command to return a rectangular array that is equal to mat except the last row of mat appears as the first and last row of the new array. Thus, the new array has four rows, and its second, third, and fourth rows are equal to the rows of mat. Recall that a semicolon separates rows. In your command, do not type specific elements of mat but commands to take a subarray and attach it to mat.

D) Write a statement to assign to extendRows the array with five rows: the last row of mat, the rows of mat, and the first row of mat. Thus, for mat having three rows, the new array has five rows.

E) Write a statement to assign to extendCols the array with five columns: the last column of extendRows from Part D, the columns of extendRows, and the first column of extendRows. Thus, for extendRows having three columns, the new array has five columns. For mat, the final result is the following 5-by-5 array:

extendCols =

9 7 8 9 7

3 1 2 3 1

6 4 5 6 4

9 7 8 9 7

3 1 2 3 1

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!