How do I get Matlab to draw a graph with solutions to an equation? I tried making matlab draw a graph for a multivariable equation, but I can't figure out how to. Tried to make an array of solution then plot it, but it didn't work.

1 Ansicht (letzte 30 Tage)
vars = [x y]
eqn = z == x^2 + 4*y^2 - 2*x + 8*y +1;
Z = solve(eqn, vars); %I don't understand the output
[X Y] = meshgrid(-4, 0.1 ,4);
surf(X, Y, Z)
%probaly not the most efficent way, but it made sense to me

Antworten (2)

Walter Roberson
Walter Roberson am 24 Mär. 2019
fsurf(rhs(eqn), [-4 4 -4 4])

madhan ravi
madhan ravi am 24 Mär. 2019
Bearbeitet: madhan ravi am 24 Mär. 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by