4 views (last 30 days)

I have to solve an equation of fourth degree with two variables, and draw the line where it is equal to zero. I tried to do that but I got an error message when I tried to place a value in x1_sol:

syms x y;

v=1/16*(3*x+17*y/3)*(-x^3-6*y^2-11*x+y)+1/96*(34*x+130*y)*/(3*x-y);

x_sol=solve(v==0,x,'MaxDegree', 4);

x1_sol=x_sol(1);

x1_sol(9);

Where am I wrong? Do I use the right way?

Valmir Sadiku
on 23 May 2013

i don't know what you are trying with this command x1_sol=x_sol(1); because the size of the x_sol are:

>> size(x_sol)

ans =

1 1

that's because it should be clear why x1_sol(9); give you an error message!

Walter Roberson
on 23 May 2013

Yvals = linspace(-10, 10, 101);

Xvals = double(subs(x_sol, y, Yvals));

Valmir Sadiku
on 23 May 2013

i never saw this command 'subs' bevor, so i think now you got the solution of your problem?

Sign in to comment.

Sign in to answer this question.

Opportunities for recent engineering grads.

Apply Today
## 3 Comments

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/76600-solve-an-equation-of-fourth-degree-with-two-variables#comment_150260

⋮## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/76600-solve-an-equation-of-fourth-degree-with-two-variables#comment_150260

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/76600-solve-an-equation-of-fourth-degree-with-two-variables#comment_150511

⋮## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/76600-solve-an-equation-of-fourth-degree-with-two-variables#comment_150511

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/76600-solve-an-equation-of-fourth-degree-with-two-variables#comment_150587

⋮## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/76600-solve-an-equation-of-fourth-degree-with-two-variables#comment_150587

Sign in to comment.