Download Matlab Exercises

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Exact cover wikipedia , lookup

Mathematical optimization wikipedia , lookup

Knapsack problem wikipedia , lookup

Computational electromagnetics wikipedia , lookup

Travelling salesman problem wikipedia , lookup

Inverse problem wikipedia , lookup

Security printing wikipedia , lookup

Multiple-criteria decision analysis wikipedia , lookup

Computational complexity theory wikipedia , lookup

Weber problem wikipedia , lookup

Transcript
Student Name:
Lab Section No.:
Class Number:
Major (BME, CEE, CS, ECE, EMSE, MAE, Undecided, Others):
E-mail (GWU):
Please complete this sheet, print it and use it as your cover sheet.
SEAS-001 – Lab Assignment and HW #2
Matlab Exercises
Problem 1.
Problem 2.
Problem 3.
Problem 4.
Total:
10 points
10 points
10 points
20 points
50 points
__________
__________
__________
__________
Grade:_________
Matlab Exercises
HW#2
SEAS-001
 Solve all given problems by creating a Matlab
m-file for each problem.
 For each problem, give a separate page
showing the m-file and Matlab solution
 On each page, print problem number, your
name and your class number.
 We recommend you to finish this assignment
and turn it in before you leave the lab.
However, if it is not ready by the end of the
lab, you MUST turn it in the beginning of the
next lab, this is absolutely your last chance to
turn in your work.
1. Find the zeros (roots) of the following
polynomial:
x5 + 9x4 – 37x3 – 357x2 – 36x + 1620 = 0
2. Given the following three equations and three unknowns, solve
for x, y, and z:
x + 2y = 20
2x + 5y – z = 46
4x + 10y – z = 95
note: these equations can be rewritten in matrix form as
1 2 0   x  20
2 5  1  y   46

   
4 10  1  z  95
Now again solve
for x, y, and z when the right
hand side changes to
x + 2y = 13
2x + 5y – z = 24
4x + 10y – z = 53
3. Use MATLAB to compute the following
expression :
sin(cos(eln25))+100(55/7-1000tan(.23))
Record your Matlab input and results in the word document by cut
and paste.
Direction: Do this by highlighting the relevant lines in the
MATLAB command window using the mouse. Then click on 'Edit'
on the menu bar and then choose 'Copy.' Now return to the word
document and click on 'Edit' and then choose 'Paste'. This will
paste the highlighted text in the MATLAB command window into
your word document.
4. Plot (on the same graph) the first 200 terms in
the sequences
an= (-1)n (n3 + n)/(n+1)3 and bn= sin(n3).
Paste your picture into a word file. Do this by clicking on 'Edit' on
the menu bar and then choosing 'Copy.' Now return to the word
document and click on 'Edit' and then choose 'Paste.' This will
paste the picture into the document.
Hints:
1. You may find it helpful to cut text from this document and
paste it back into the MATLAB command window.
2. Be very careful to use the "dot" arithmetic operations in
problem 2. These are needed when you are working with
arrays or lists of numbers.
3. For Problem 1. try learning and using the command “roots”.
Type in “help roots” at the MATLAB command prompt.