Question: In Matlab, solve the 'Eva' problem. Obtain the matrix R from the file ps 2 _ R . mat from the course website; download it

In Matlab, solve the 'Eva' problem. Obtain the matrix R from the file ps2_R.mat from
the course website; download it and save it in whatever folder Matlab is running in, and
load it by typing load ps2_R at the prompt in the Matlab command window. This
creates a variable called R in the Matlab environment that you can use for subsequent
statements. Take rp=1.1(i.e., desired return of 10%). Follow the steps described on
Slide 7 of file M08, which were also presented in lecture. At the end of the procedure,
exhibit the vector x*. Hand in a copy of the command window that shows each step. If
you use a script, hand in the listing of the script and the output. You can also choose
to write a function (not required); in this case, hand in the function listing and a test
run.
Here are some features of Matlab needed for this question:
If A is a matrix, then ??(A,1) returns a row vector that is the sum of the rows
of A.(Similarly, sum (A,2) returns a column vector that is the sum of the columns
of A.)
To make an mn matrix of all 1's, use A=ones(m,n);. This statement generates
a row vector if m=1 or a column vector if n=1. There is an analogous function
for all 0's called zeros.
Matrix transposition in Matlab is indicated with an apostrophe symbol: A2'
means A2T.
Put trailing semicolons on statements to avoid displaying the result of each step
in the command window. Omit them to display the result.
Multiplication (matrix-matrix, matrix-vector, and scalar) is denoted with an as-
terisk, e.g., the statement bbar=A1*x0; multiplies A1 and x0, and assigns the
result to ?bar(b).
To apply a matrix inverse to a vector, use the ??? operation, which solves a linear
system. For example, to compute (R2-Tb) in Matlab, you would use the expression:
((R2')\b).
To extract submatrices, use the colon notation. For example, the statement
[Qtilde,Rtilde]=qr(Abar); followed by Ybar=Qtilde(:,1:8); sets ?bar(Y) to the
first eight columns of the Q factor in the QR -factorization of ?bar(A).
In Matlab, solve the 'Eva' problem. Obtain the

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!