1、这里以椭圆方程(x+3)²/9+(y-5)²/4=1为例plot椭圆曲线。

2、首先利用方程cos(t)²+sin(t)²=1,将椭圆方程转化为:
x=-3+3cos(t)
y=5+2sin(t)

3、matlab定义t的取值范围:
t=[0:0.1:2*pi];

4、matlab确定xy轴坐标:
x=-3+3*cos(t);
y=5+2*sin(t);


5、matlab绘制plot椭圆图:
plot(x,y);

6、添加栅格:
grid minor;

7、完整matlab代码:
t=[0:0.1:2*pi];
x=-3+3*cos(t);
y=5+2*sin(t);
plot(x,y);
hold on
grid minor