自己写到函数积分的部分了,但是出现了问题,说是积分的索引值应当是正实数,不知道问题出在哪里。求各位大神帮忙解答~代码如下:
fs=1/.0001;
t=-.5:.0001:.5;
fc=200;
ct=cos(2*pi*fc*t);
fun=@(t)0.*(t=0&t=0.05&t=0.1);
mt=fun(t);
for ta=1:length(t)
s(t)=quadl(fun,-.5,0.5);
end
figure(1)
subplot(211)
plot(t,mt);
title('m(t)');
xlabel('t/sec'),ylabel('Amplitude');
subplot(212)
plot(t,s);
title('s(t)');
xlabel('t/sec'),ylabel('Amplitude');