Question: Due Friday by 1 1 . 5 9 pm My Solutions ? MAT 3 4 3 : LAB 2 Problem 4 Please read these instuctons

Due Friday by 11.59 pm
My Solutions ?
MAT 343: LAB 2 Problem 4
Please read these instuctons beforeyou attempt to solve this problem. belowit
that is
Wre a function named myrowproduct that :akes in inpta mawno A, a column vector x and a random numberk. and es cupuigues ne froduct y = Ax computed pyrow as cofined asove, and the intermediate value, z, of the cutput yevorat he end of k iterations th sintermedige value sused by MuTL4B Grader to determine whether your code is correct
Specific instructions for writing the function:
Extrat the dimenson of asing the command wwe and store the resulin the variables n and n.
Extract thedmenstonof ubing the command tot and stone the result in the variables p and q
Usear &t statement to pertorm a checkon the d mensions to detamine whether the multiplication is defined and whether as a col unn wector.
If the multiplication is defined and x is a columin vector
witialize the vecter y as a vector of zeros of the sappoprotate dimension
use a single fou loop to evaluate the entries of the product y = Ax. The loop counter should be the veriatle 1. Each teratign of the the lopp sinpuld ewaluats the th component of the vector y as the product. of the ith row of A times the vector x. Asto , ing de the for loop, aiter you compute the th comocnent of y. insert the following commands
1t teesual (ann)
2*y:
ena
If the muliplication is not defined or x is not a column vector), display the message dimensions do not match and retum an empry y vector and an empty z vector:
Don't forget to include your name as a comment in your function.
WOTE: there is no parmal credit on this question.
Function
Due Friday by 1 1 . 5 9 pm My Solutions ? MAT 3 4

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 Programming Questions!