早教吧 育儿知识 作业答案 考试题库 百科 知识分享

matlab小问题用subplot在一个图象窗口中作下列四条曲线,并为每幅图形加上标题:1)概率曲线y=e^(-x^2)x2)四叶玫瑰线ρ=sin2θ3)叶形线x=3t/(1+t^3)y=3t^2/(1+t^3)4)摆线x=a(t-sint),y=a(1-cost),t∈[0,2π].

题目详情
matlab小问题
用subplot在一个图象窗口中作下列四条曲线,并为每幅图形加上标
题:
1) 概率曲线y=e^(-x^2)
x
2) 四叶玫瑰线 ρ=sin2θ
3) 叶形线x=3t/(1+t^3)
y=3t^2/(1+t^3)
4)摆线x=a(t-sint),y=a(1-cost),t∈[0,2π].
▼优质解答
答案和解析
>> x = -2:0.1:2;
>> y = exp(-(x.^2));
>> theta = linspace(0,2*pi);
>> rho = sin(2*theta);
>> t1 = linspace(0,30,1000);
>> x3 = 3*t1./(1+t1.^3);
>> y3 = 3*t1.^2./(1+t1.^3);
>> t2 = linspace(0,2*pi);
>> x4 = t2 - sin(t2);
>> y4 = 1 - cos(t2);
>> subplot(2,2,1);plot(x,y);title('概率曲线 y = exp(-x^2)')
>> subplot(2,2,2);polar(theta,rho),title('四叶玫瑰线 p = sin(2*t)')
>> subplot(2,2,3);plot(x3,y3);title('叶形线');
>> subplot(2,2,4);plot(x4,y4);title('摆线');