x^2 + y^2 =9

22 vues (au cours des 30 derniers jours)
Duong Manh
Duong Manh le 29 Oct 2019
I want to plot the above equation in matlab but i dont know how to plot please help or provide me code

Réponses (1)

Dimitris Kalogiros
Dimitris Kalogiros le 29 Oct 2019
Modifié(e) : Dimitris Kalogiros le 29 Oct 2019
This equation depicts a circle with radious 3.
clc; clearvars;
syms x y
eq= x^2+y^2==9
fimplicit(eq, [-3 3]);
xlabel('x'); ylabel('y');
ax=gca;
ax.YAxisLocation='origin'; ax.XAxisLocation='origin' ;
ax.XLim=[-5 5]; ax.YLim=[-5 5];
In case you are not familiar with symbolic math toolbox, you can use the following
clc; clearvars;
ci=@(x,y) x.^2+y.^2-9;
fimplicit(ci, [-3 3 -3 3]);
xlabel('x'); ylabel('y');
ax=gca;
ax.YAxisLocation='origin'; ax.XAxisLocation='origin' ;
ax.XLim=[-5 5]; ax.YLim=[-5 5];

Catégories

En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by