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 pm
My Solutions
MAT : LAB Problem
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 and a random numberk. and es cupuigues ne froduct y Ax computed pyrow as cofined asove, and the intermediate value, of the cutput yevorat he end of iterations th sintermedige value sused by MuTLB 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 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 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 Asto ing de the for loop, aiter you compute the th comocnent of y insert the following commands
teesual
:
ena
If the muliplication is not defined or 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
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
