Thursday
April 24, 2014

Homework Help: Computer Science - MATLAB

Posted by Lee on Wednesday, July 20, 2011 at 5:28pm.

thanks mathmate. It's way above my head to. I got another question

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.


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.

>> 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

I was expecting my results to differ and to get the exact result when used integers and a estimate when I used digits with numbers. Do you know why this may have occurred? My friend ran the exact code on a much older version of MATLAB and produced the expected results, the exact answer were he entered digits

one=sym('x^2+y^2-42');
two=sym('x+3*y+2*y^2-6');
[x,y]=solve(one,two)

and a rounded answer when he didn't

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)

we both can't seem to figure out why I'm not getting the same results when I run the same exact program in MATLAB

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

Algebra - we are doing sloving system of linear equations by substituting 1)y=5x...
countiblis,math - How did you get: x = 2; y = -1 for Directions: Sove the system...
7th grade math check - Ok I was wondering if you could check these 3 problems ...
Algebra - Find all solutions to the following system of equations: x + 3y + 2z...
Algebra - consider the following equations: 6x = 2y - 9 9 - y + 3x = 0 1/3y = x...
Math - Learning about quadratic functions and equations, and I am struggling. It...
QUESTION ABOUT JISHKA - Do you guys have a tutor that specialized in computer ...
Algebra - The teacher wants us to do the following problem by using substitution...
TO DRWLS/MATH HELP PLEASE - How do i solve inequalitites with three variables. I...
algebra - I am to solve this system of equations x+3y=8 x=4-3y I got (2,2), but ...

Search
Members