GreenPrint
- 1,186
- 0
Homework Statement
Consider the following two equations:
x^2 + y^2 = 42
x + 3y + 2y^2 = 6
Define a symbolic equation for each, and solve it by using MATLAB's symbolic capability. Could you solve these equations by using matrices? Try this problem twice, once using only integers in your equation definitions and once using floating-point numbers (those with decimal points). how do your results vary? Check the workspace window to determine weather the results are still symbolic.
Homework Equations
The Attempt at a Solution
I think that I may be doing something wrong because when I wrote out my code and ran it I got the same exact results when I tried using integers and when I included decimal points. I was hoping someone could explain to me what I'm doing wrong because I guess I'm suppose to get different results.
Code:
>> disp('No you could not solve this problem usign matrices.')
one=sym('x^2+y^2-42');
two=sym('x+3*y+2*y^2-6');
[x,y]=solve(one,two)
one=sym('x^2.0+y^2.0-42.0');
two=sym('x+3.0*y+2.0*y^2.0-6.0');
[x,y]=solve(one,two)
No you could not solve this problem usign matrices.
x =
-6.2161908711674029137999766546085
6.4782037201238076694174751205659
6.3321946913754454971273459117746
-5.594207540331850252744844377732
y =
1.8327495882457713513416277757555
-0.18131894709064188368251606877471
-1.3796051574695662000556283784362
-3.2718254836855632676034833285446
x =
-6.2161908711674029137999766546085
6.4782037201238076694174751205659
6.3321946913754454971273459117746
-5.594207540331850252744844377732
y =
1.8327495882457713513416277757555
-0.18131894709064188368251606877471
-1.3796051574695662000556283784362
-3.2718254836855632676034833285446
Thanks in advance!