MATLAB怎么画这个函数的图啊?
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/11/07 19:31:15
MATLAB怎么画这个函数的图啊?
其中l表示阶跃函数 谁能回答加10分
其中l表示阶跃函数 谁能回答加10分
clear all;
step = 0.000002;
d1 = 4.5e-4;
d2 = 5.5e-4;
d3 = 7.5e-4;
d4 = 8.0e-4;
d5 = 9.8e-4;
d6 = 1.7e-4;
a1 = 1.0;
a2 = 7.0;
a3 = 5.0;
a4 = 6.0;
a5 = 5.5;
a6 = 7.0;
ds1 = round(d1/step);
ds2 = round(d2/step);
ds3 = round(d3/step);
ds4 = round(d4/step);
ds5 = round(d5/step);
ds6 = round(d6/step);
t = (0:step:step*1000)';
mf = exp(-t/5e-6);
f1 = a1*[zeros(ds1,1);mf(1:length(mf)-ds1)];
f2 = a2*[zeros(ds2,1);mf(1:length(mf)-ds2)];
f3 = a3*[zeros(ds3,1);mf(1:length(mf)-ds3)];
f4 = a4*[zeros(ds4,1);mf(1:length(mf)-ds4)];
f5 = a5*[zeros(ds5,1);mf(1:length(mf)-ds5)];
f6 = a6*[zeros(ds6,1);mf(1:length(mf)-ds6)];
ut = f1+f2+f3+f4+f5+f6;
figure(1);
subplot(2,1,1),plot(t,f1,t,f2,t,f3,t,f4,t,f5,t,f6);
subplot(2,1,2),plot(t,ut);
step = 0.000002;
d1 = 4.5e-4;
d2 = 5.5e-4;
d3 = 7.5e-4;
d4 = 8.0e-4;
d5 = 9.8e-4;
d6 = 1.7e-4;
a1 = 1.0;
a2 = 7.0;
a3 = 5.0;
a4 = 6.0;
a5 = 5.5;
a6 = 7.0;
ds1 = round(d1/step);
ds2 = round(d2/step);
ds3 = round(d3/step);
ds4 = round(d4/step);
ds5 = round(d5/step);
ds6 = round(d6/step);
t = (0:step:step*1000)';
mf = exp(-t/5e-6);
f1 = a1*[zeros(ds1,1);mf(1:length(mf)-ds1)];
f2 = a2*[zeros(ds2,1);mf(1:length(mf)-ds2)];
f3 = a3*[zeros(ds3,1);mf(1:length(mf)-ds3)];
f4 = a4*[zeros(ds4,1);mf(1:length(mf)-ds4)];
f5 = a5*[zeros(ds5,1);mf(1:length(mf)-ds5)];
f6 = a6*[zeros(ds6,1);mf(1:length(mf)-ds6)];
ut = f1+f2+f3+f4+f5+f6;
figure(1);
subplot(2,1,1),plot(t,f1,t,f2,t,f3,t,f4,t,f5,t,f6);
subplot(2,1,2),plot(t,ut);