Monday
July 28, 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

MATLAB for MathMate - Would you please help Lee with his problem? Sra
Computer Science - MATLAB - Thanks MathMate. Print plotting sounds awful O_O. ...
Thank You MathMate - Thank you for assisting me with my MATLAB question. If I ...
algebra 1 - I'm stuck on this problem. Can you help? -4x-9y=1 -x + 2y =-4 WHat ...
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 ...
computers - Hey mathmate is it posible to make the computer read my powerpoint ...
AlgebrAlgebra-Mathmate or BobPursley or Reiny - I had asked a question earlier ...
FOR MATHMATE - Media services charges $40 for a phone and 20/mth for its economy...
Algebra - Here is the problem: Given f(x)=-x^3+3x^2-2x+6, find f(-1), f(0), and ...

Search
Members