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, 21.06.2019 17:00
How to solve a simultaneous equation involved with fractions?
Answers: 1
question
Mathematics, 21.06.2019 20:30
The sum of these consecutive integers is equal to 9 less than 4 times the least of the integer. find the three integers
Answers: 1
question
Mathematics, 22.06.2019 00:30
I've been working on this for a few days and i just don't understand, it's due in a few hours. you. the direction of a vector is defined as the angle of the vector in relation to a horizontal line. as a standard, this angle is measured counterclockwise from the positive x-axis. the direction or angle of v in the diagram is α. part a: how can you use trigonometric ratios to calculate the direction α of a general vector v = < x, y> similar to the diagram? part b suppose that vector v lies in quadrant ii, quadrant iii, or quadrant iv. how can you use trigonometric ratios to calculate the direction (i.e., angle) of the vector in each of these quadrants with respect to the positive x-axis? the angle between the vector and the positive x-axis will be greater than 90 degrees in each case. part c now try a numerical problem. what is the direction of the vector w = < -1, 6 > ?
Answers: 1
question
Mathematics, 22.06.2019 00:40
Find the volume of the solid bounded by the plane z=0 and the paraboloid z=1-x^2 –y^2
Answers: 1
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
Mathematics, 20.08.2020 17:01
question
Mathematics, 20.08.2020 17:01
question
Mathematics, 20.08.2020 17:01
question
Mathematics, 20.08.2020 17:01
Questions on the website: 13722363