matlab怎么写ft2

1.matlab中绘制f(t)=(依我理解,u(t)应该为阶跃函数 。则程序截图如下:
对应生成图像如下:
希望能给到帮助 。
2.用Matlab编程产生f(t)=1(第一种
>> [email protected](t)1*(t>-2&t=2|t> f(1)
ans =
1
>> f(6)
ans =
0
第二种
function y=fun0410(t)
if t>-2&t>fun0410(1)
【matlab怎么写ft2】ans =
1
>> fun0410(6)
ans =
0
3.用MATLAB的向量表示法描述f(t)=cos(πt/2)[u(t)你那u(t)是啥表达式?啥叫向量表达法?f1=[zeros(1,2),ones(1,5),zeros(1,4)];这句跟逻辑数组作用是相同的,搞这么麻烦干啥?fi和t的大小不同,导致f=cos(pi*t/2).*f1;这句的乘法没法运行,你这到底要干啥呀?
clear all
t=-2:0.01:8;
f=cos(pi*t/2).*(t>=0&t<=4);
plot(t,f),axis([-2,8,-1.2,1.2]);

matlab怎么写ft2

文章插图