MATH/CMSC 206 - Introduction to Matlab

Announcements Syllabus Tutorial Projects Submitting

Answers to Self-Test

1. We are about to use the variables x and y in some formulas -- declare them as "symbolic".

syms x y

2. Write a MATLAB command that will find the solutions to the equation x^2 - x = 7.

solve(x^2 - x - 7)
 
ans =
 
 1/2 - 29^(1/2)/2
 29^(1/2)/2 + 1/2
 
3. Use MATLAB to find solutions to the system of equations consisting of: 2x + 3y = 60 and -x = 2y + 20
[x y] = solve(2 * x + 3 * y - 60, x + 2 * y + 20)
 
x =
 
180
 
 
y =
 
-100