Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Print m files and outputs and any data files created Number all tasks Remember t

ID: 3120613 • Letter: P

Question

Print m files and outputs and any data files created Number all tasks Remember to use comments to you and the user Define the array A= -4:3 Obtain array x by extracting the first 4 elements of the array A Obtain array y by extracting the last 4 elements of the array A Obtain array z by stacking arrays x and y horizontally (this should be same as array A) Obtain array T by stacking arrays x and y vertically (x must be on top of y) Change x and y to column vectors and name them as P and Q Obtain array R by stacking arrays x and y horizontally

Explanation / Answer

A = -4:3 % Defining array A
x = A(1:4) % Extracting first 4 elements of array A
y = A(5:8) % Extracting last 4 elements of array A
z = horzcat(x,y) % Stacking arrays x and y horizontally
T = vertcat(x,y) % Stacking arrays x and y vertically
P = reshape(x,[4,1]) % Changing x to column vectors
Q = reshape(y,[4,1]) % Changing y to column vectors
x = P;
y = Q;
R = horzcat(x,y) % stacking x and y horizontally

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote