作业帮 > 综合 > 作业

我想想用matlab得到一个门函数的时移图像,为什么得不到呢,其程序为

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/17 05:43:29
我想想用matlab得到一个门函数的时移图像,为什么得不到呢,其程序为
clc
subplot(4,1,1);
t=-1:0.001:1;
y1=1;
plot(t,y1)
subplot(4,1,2);
y2=subs(y1,t,t-1)
plot(t,y2)
subplot(4,1,3);
y3=subs(y1,t,t-1)
plot(t,y3)
subplot(4,1,4);
y4=subs(y1,t,t-1)
plot(t,y4)
难道是subs只用于符号函数吗
你y1=1是个常数,又不含有t,你去替换什么呢?
再问: 那我应该怎么修改才能得到y1的时移图像呢
再答: 你y1想怎么运算啊?
再问: 晕,我不是在上面说了吗,想得到y1的时移图像,即将y1向左向右平移
再答: 那平移t就行了啊 clear;clc; t=-1:0.001:1; l=length(t); y1=ones(1,l); y1(1)=0; y1(l)=0; subplot(4,1,1); plot(t,y1) axis([-8 8 -2 2]) subplot(4,1,2); t2=t+1;%向右平移一个单位 plot(t2,y1) axis([-8 8 -2 2]) subplot(4,1,3); t3=t+4;%向右平移四个单位 plot(t3,y1) axis([-8 8 -2 2]) subplot(4,1,4); t4=t-2;%向左平移两个单位 plot(t4,y1) axis([-8 8 -2 2]) 是这个意思不?