subject
Mathematics, 13.02.2020 04:26 cashhd1212

The product y = Ax of an m × n matrix A times a vector x = (x1, x2, . . . , xn) T can be computed row-wise as y = [A(1,:)*x; A(2,:)*x; ... ;A(m,:)*x]; that is y(1) = A(1,:)*x y(2) = A(2,:)*x ... y(m) = A(m,:)*x Write a function M-file that takes as input a matrix A and a vector x, and as output gives the product y = Ax by row, as defined above (Hint: use a for loop to define each entry of the vector y.) Your M-file should perform a check on the dimensions of the input variables A and x and return a message if the dimensions do not match. Call the file myrowproduct. m. Note that this file will NOT be the same as the myproduct. m example. Test your function on a random 3 × 7 matrix A and a random 7 × 1 vector x. Compare the output with A*x. Repeat with a 2 × 6 matrix and a 6 × 1 vector and with a 2 × 6 matrix and a 1 × 6 vector. Use the command rand to generate the random matrices for testing. Include in your lab report the function M-file and the output obtained by running it.

ansver
Answers: 3

Another question on Mathematics

question
Mathematics, 20.06.2019 18:04
Can i get some on 18,20,& 22? or one of them
Answers: 1
question
Mathematics, 21.06.2019 17:00
When only separate discreet points are graphed it is called?
Answers: 1
question
Mathematics, 21.06.2019 21:40
The number of chocolate chips in a bag of chocolate chip cookies is approximately normally distributed with a mean of 12611261 chips and a standard deviation of 118118 chips. (a) determine the 2626th percentile for the number of chocolate chips in a bag. (b) determine the number of chocolate chips in a bag that make up the middle 9696% of bags. (c) what is the interquartile range of the number of chocolate chips in a bag of chocolate chip cookies?
Answers: 2
question
Mathematics, 22.06.2019 02:00
Need to finish my juan wants to build a greenhouse in his back yard. he needs to maximize the ratio of floor area to structure volume in order to provide the most room for plants while minimizing the area to be heated. find the description of the structure that best meets juan’s criteria. a.) a hemisphere with a diameter of 12 feet b.) a cube with a side length of 12 feet c.) a cone with a diameter of 12 feet and a height of 10 feet d.) a square pyramid with a base side length of 12 feet and a height of 9 feet
Answers: 2
You know the right answer?
The product y = Ax of an m × n matrix A times a vector x = (x1, x2, . . . , xn) T can be computed ro...
Questions
question
Computers and Technology, 04.08.2019 06:00