用matlab画椭圆?如的程序怎么写?

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/01 02:06:42
用matlab画椭圆?如的程序怎么写?

用matlab画椭圆?如的程序怎么写?
用matlab画椭圆?

的程序怎么写?

用matlab画椭圆?如的程序怎么写?
可以用椭圆的参数方程嘛.
x=-2+2cos(t)
y=6+3sin(t)
t从0到2*pi.
 
具体程序就是:
>> t=linspace(0,2*pi,1000);
>> x=-2+2*cos(t);
>> y=6+3*sin(t);
>> plot(x,y),grid on
 
画出来的就是这样:

Matlab(R2013b)

>> syms x y
>> h=ezplot(((x+2)^2)/4+((y-6)^2)/9==1,[-4 0 3 9]);
>> set(h,'color','r');
>> set(h,'linewidth',2);
>> grid on

Output as follow: