Question: MATLAB (a) Create a (2x4) vector such that the first column elements are all 1s, and the second column elements are all 0s, elements of
MATLAB
(a) Create a (2x4) vector such that the first column elements are all 1s, and the second column elements are all 0s, elements of (1,3)and (2,4) are 2.9, and the rest of the elements are 0s. You must create this matrix with a single command. Do not type the vector elements explicitly. Assign this matrix to a variable calls sing_com. (b) With another single command create a row vector that its first element is 4 and its last element is 1 with an increment of -1. Do not type the vector elements explicitly. Assign this vector to a variable calls sing_row_com (c) With a single command append the sing_row_com vector to the bottom of the sing_com matrix and assign this new matrix to a variable calls app_mat. (d) Write a command with linspace() to create a row vector from 2 to 5 and assign that to a variable calls fifth_row. (e) Append the fifth_row row vector to the top of the app_mat marix and assign it to variable linsp_matrix. (f) Delete the thrid colomn of the linsp_matrix then assign it to the final_matrix variable.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
