Each
of the problems below is intended to be solved by generating a script or
m-file. Be sure to have a very clearly written header for each M-file so that
anyone reading your work can decipher the sort of problems you are solving in
each M-file. Also, be sure to label all axes and assign each plot a title.
- Read the HELP pages on the
following functions (either by typing "help" and then the
function name at the MATLAB command prompt, or by clicking these links):
size,
det,
slash,
eye,
diag,
inv,
diary,
rand
Turn in all of Problem #2 as a single M-file. When you are asked to perform a matrix opertion, your M-file should output the results to the screen. Now, you can use the DIARY command to log all the results of your calculations. Some of the things you're asked to do here aren't going to work! When you turn your diary logfile besure to explain why these particular operations resulted in errors.
**Submit a single M-file and one diary logfile.** - Given the
following matrices:
- Using the
colon operator, create a matrix
**C1**with the last two rows of**A**. - Using the
colon operator, create a matrix
**C2**with rows 1, 2, and 3 and columns 3 and 4 of matrix**A**. - Using the
colon operator, create a matrix
**C3**with columns 2 and 3 of**A**. - Form a matrix
**C4**by placing**C3**and**B**side by side. - Find the product
of
**A**_{23}and**B**_{32}. - Find the
product of matrices
**A**and**B**. - Find the
product of matrices
**B**and**A**. - Find the
inverse of matrix
**A**. - Find the
inverse of matrix
**B**. - Transpose
matrix
**A**(i.e., Find**A**^{T}). - Transpose
matrix
**B**(i.e., Find**B**^{T}). - Find the
product of matrices
**A**^{T}and**B**^{T}. - Find the
product of matrices
**B**^{T}and**A**^{T}. - Find the
diagonal of matrix
**A**.
- Plot the
following two equations on the same graph: 1.0·X
_{0}= 1.0·X_{1}+ 0 and 1.0·X_{0}= -1.0·X_{1}+ 1.0, where variable X_{1}goes from -5.0 to +5.0 in steps of 0.01.**N.B.**These are just linear equations of the form Y = MX + b. Where do these graphs intersect? - Now, express these two
equations in standard matrix form. That is
**Ax = b**where**A**is the coefficient matrix,**x**is the variable matrix and**b**is the solution matrix. Solve for**x**by using both matrix division and the inverse (inv) command. What are the resulting values and what do they mean interms of our previous graph?
For problems #5 and 6 we are going to begin with a graphical interpretaion of solving a system of simultaneous equations.**Submit a single M-file and two plots along with your explanations and interpretaions of the problem**. Click here to see what your resulting plots should look like. - Now, use the
following
**A**,**x**and**b**matrices:
First, solve for the vector**x**and then plot out the graphs corresponding to these two equations. What is the relationship between the graphs and the matrix solution? - Now, use the following
**A**,**x**and**b**matrices:
First, solve for the vector**x**and then plot out the graphs corresponding to these two equations. What is the relationship between the graphs and the matrix solution? Did you have troubles coming up with a solution for the matrix? Explain why in terms of the graph that you've generated for this problem.
For problems #7-10 we are going to use Matlab to perform some standard matrix operations. Here, generate an M-file to perform all of these operations. When you are asked to perform a matrix opertion, your M-file should output the results to the screen. Now, you can use the DIARY command to log all the results of your calculations.**Submit a single M-file and one diary logfile.**
**A**.
8.
9.
- Using both
coefficient matrices from the problem above calculate the following:
- The square of
each matrix.
- The matrix
that results when each element is raised to the third power.
- The product
of the transpose and the inverse of each coefficient matrix.
- The square
root of the absolute value of each values in both coefficient matrices.
- Generate a 5 x
5 matrix of random numbers and call it
**A**. - What is the
result of
**A**divided by**A**? - What is the
result of the matrix multiplication of
**A**and the inverse of**A**? - The results
of these two problems produce a "special" matrix with what
name?
- Generate a 5 x
5 idenity matrix and call it
**I**. - What is the
result of an element by element multiplication of
**A**and**I**? What is this called and what is another, much simpler way to generate this matrix? - What is the
result of the matrix multiplication of
**A**and**I**?
To continue on to the next
core lesson, click here. |