필터 지우기
필터 지우기

x^2 + y^2 =9

조회 수: 7 (최근 30일)
Duong Manh
Duong Manh 2019년 10월 29일
답변: Image Analyst 2024년 5월 11일
I want to plot the above equation in matlab but i dont know how to plot please help or provide me code

답변 (2개)

Dimitris Kalogiros
Dimitris Kalogiros 2019년 10월 29일
편집: Dimitris Kalogiros 2019년 10월 29일
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];

Image Analyst
Image Analyst 2024년 5월 11일
viscircles([0,0], 3); % Plot circle centered at (0,0) and with radius 3
grid on; % Show gridlines
axis square % Make sure it's square and not elliptical by making x and y scale the same

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by