Question: Exercise 3 Write a Matlab/Octave program matrix.times vector.m that computes the prod uct between an n-dimensional square matrix A and an n-dimensional (column) vector x.

 Exercise 3 Write a Matlab/Octave program matrix.times vector.m that computes the

Exercise 3 Write a Matlab/Octave program matrix.times vector.m that computes the prod uct between an n-dimensional square matrix A and an n-dimensional (column) vector x. The components of the (column) vector y - Ax are defined n. The function should be of the following form function [y] matrix-times-vector(A,x) = Input: A: n n matrix x: n 1 vector Output y: n 1 vector You are not allowed to use the Matlab expression A*x within your function. Hint: You can use two nested for loops to compute the vector y (one loop computes the sum (3) while the other one controls the index i in (3)). The size of the matrix A can be determined by using the Matlab command size(A) (see the Matlab/Octave documentation). You can debusg your function by comparing the output with the Matlab expression A*x, for simple matrices A and vectors x

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