MATLAB怎么做两个figure?我想做两个figure 一个是星形线,一个是四叶玫瑰线,这是我的代码theta=linspace(0,2*pi,400);rou=4*sin(2*theta);figure(1)hold onpolar(theta,rou);b=2;fh=@(x,y)x^(2/3)+y^(2/3)-b^(2/3)ezplot(fh)t=-2*pi:0.1:2

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/05 15:12:39
MATLAB怎么做两个figure?我想做两个figure 一个是星形线,一个是四叶玫瑰线,这是我的代码theta=linspace(0,2*pi,400);rou=4*sin(2*theta);figure(1)hold onpolar(theta,rou);b=2;fh=@(x,y)x^(2/3)+y^(2/3)-b^(2/3)ezplot(fh)t=-2*pi:0.1:2

MATLAB怎么做两个figure?我想做两个figure 一个是星形线,一个是四叶玫瑰线,这是我的代码theta=linspace(0,2*pi,400);rou=4*sin(2*theta);figure(1)hold onpolar(theta,rou);b=2;fh=@(x,y)x^(2/3)+y^(2/3)-b^(2/3)ezplot(fh)t=-2*pi:0.1:2
MATLAB怎么做两个figure?
我想做两个figure 一个是星形线,一个是四叶玫瑰线,这是我的代码
theta=linspace(0,2*pi,400);
rou=4*sin(2*theta);
figure(1)
hold on
polar(theta,rou);
b=2;
fh=@(x,y)x^(2/3)+y^(2/3)-b^(2/3)
ezplot(fh)
t=-2*pi:0.1:2*pi;
x=cos(t).^3;y=sin(t).^3;
figure(2);plot(x,y)
做出来以后四叶玫瑰线就跑到星形线的坐标轴里了

MATLAB怎么做两个figure?我想做两个figure 一个是星形线,一个是四叶玫瑰线,这是我的代码theta=linspace(0,2*pi,400);rou=4*sin(2*theta);figure(1)hold onpolar(theta,rou);b=2;fh=@(x,y)x^(2/3)+y^(2/3)-b^(2/3)ezplot(fh)t=-2*pi:0.1:2
你干嘛要画3副图呢,figure(1)里有2个图,当然会重叠了
要不就画3副,要不就去掉一副:
clear all;clc;
theta=linspace(0,2*pi,400);
rou=4*sin(2*theta);
figure(1);
polar(theta,rou);hold on;
t=-2*pi:0.1:2*pi;
x=cos(t).^3;
y=sin(t).^3;
figure(2);
plot(x,y);
b=2;
fh=@(x,y)x^(2/3)+y^(2/3)-b^(2/3);
figure(3)
ezplot(fh);