


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



You will need to know linear algebra operations and nested iteration to com- plete this assignment. Woody Allen tells us, “Life is divided into the horrible and the miserable.” The estimated time to completion for this assignment is five hours. Budget your time accordingly.
Corrections and revisions to this assignment should be sent to Titus Barik ([email protected]). For general assistance, contact the Teaching Assis- tant for your section.
Write a script, sys.m, which solves the following system of equations:
6 x 1 + 3x 2 + 1x 3 + 2x 4 + 4x 5 = 70 (1) 1 x 1 + 9x 2 + 1x 3 + 2x 4 + 1x 5 = 56 (2) 1 x 1 + 1x 2 + 1x 3 + 6x 5 = 63 (3) 1 x 2 + 2x 3 + 3x 4 + 5x 5 = 69 (4) 4 x 1 + 3x 2 = 13 (5)
Given a square 2 × 2 matrix, determine the number of singular matrices containing only combinations of the values 1 and 0. A singular matrix is a square matrix that does not have an inverse. Compute this result using a MATLAB script and name your script sing.m.
Write a script, multigraph.m, which, when run, will simultaneously display three windows with graphs representing the following equations from the
−
0
5
−
0
50
10
20
30
40
50
(a) z = x^2 + y^2
−
0
5
−
0
−0.8 5
−0.
−0.
−0.
0
1
(^) (b) z = (cos x)(cos y)e √ x^2 +y^2 / 8
Figure 1: Example of mesh output.
range [-5:0.2:5] to [-5:0.2:5]:
z = x^2 + y^2 (6) z = (cos x)(cos y)e
x^2 +y^2 / (^8) (7)
z =
xy(x^2 − y^2 ) x^2 + y^2
You will need the functions mesh, meshgrid, and figure. Examples of mesh graphs are shown in Figure 1.
Consider the following m × n matrix, A, consisting of the values V = { 0 , 1 , − 1 }, where 0 represents an open space, 1 represents a vertically falling object, and −1 represents a fixed block.
Re-implement the MATLAB function reshape(x, m, n), as specified in help reshape. That is, return the m × n matrix whose elements are taken column-wise from x. You may assume that the input is valid. Call your function myreshape(x, m, n).
You will need to turn in the following files: sys.m, sing.m, multigraph.m, gravity.m, life.m, myreshape.m. Be sure to include test scripts that test the functionality of the above problems. Finally, properly document all func- tions. For this assignment, functions with syntax errors will receive no credit.