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

Forming Matrices: Enter a two by two matrix named A that is made of all ones. Us

ID: 3782824 • Letter: F

Question

Forming Matrices: Enter a two by two matrix named A that is made of all ones. Use a command. >> A=ones(2, 2) >> A=ones(2) Both a and b are correct. >> A= ones (1, 2) Use linspace command to enter a vector B that starts with one and goes to hundred and has 20 elements. B = linspace (1, 20, 100) B = linspace (1, 20) B = linspace (1, 100, 20) Both a and b are correct. Make a new vector X that uses the first three elements of vector B from above. X = B(3) X = B(1:3) X = B(1, 2, 3) X = B([1 2 3]) Both b and d Both b and c Take the transpose of this vector and save it as X2. X2 = X' X2 = transpose(X) X2 = 1/X Both a and b are correct

Explanation / Answer

Q1:

Ans:B i.e.A=ones(2) It will return 2*2 matrix with all ones in it

==============================================

Q2:

Ans:Option A

y = linspace(a,b) generates a row vector y of 100 points linearly spaced between a and b.

y = linspace(a,b,n) generates n points.

Hence,It matches with Option A only where a=1,b=20 and n=100

====================================================

Q3:Ans e i.e.Both b and d

x=B(1:3) returns elements from position 1 to 3

x=B(1,2,3) Extract the first, second, and third elements

=========================================================

Q4:Ans:d i.e. both a and b are correct

X.' and transpose(X) gives transpose of vector X