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

P = H(1: 2, ) generates a matrix based on H selecting only first and second colu

ID: 3788343 • Letter: P

Question

P = H(1: 2, ) generates a matrix based on H selecting only first and second columns of H and all its rows. only first and second rows of H and all its columns. first row of H and second column of H. first and third rows of M and all its columns. If a=[3 7 1 10] and d= [ 1: 4], write a command to make vector a into a column vector and then multiply each element by the sum of the element of d. Name this g. >> g = add(d) * a' >> g = sum(d) * a' >> g = a' * sum(d) Last two answers are correct. Write a command to produce a column vector based on row vector d (where d [1: 4]) by adding two lines to vector d with the values 4 and 8 Name this new vector d4_h. >> d4_h =[d'; 4; 8] >> d4_h = [ d', 4, 8] >> d4_h = [ d; 4; 8] Alex and Susan want to create a vector of strings in Matlab for their potluck event. Which one is correct? >> info = [First name Last name Appetizer Lunch Dessert] >> info-('First name' 'Last name' 'Appetizer' 'Lunch' 'Dessert'] >> info = [ 'First name' 'Last name' 'Appetizer' 'Lunch' 'Dessert') >> Info = {'First name' 'Last name' 'Appetizer' 'Lunch' 'Dessert'}

Explanation / Answer

1. B

B option is true becuase in Matlab 1:2 means only two and when only : symbol is given, then it means all.

2. C

C option is true because after creating a' in order to satisfy Matrix multiplication property we must put sum(d) afterwards.

3. C

4. B

Option B is correct because this is correct syntax.