matlab 用变量替换表达式syms w t nsyms T positive;a0=(1/(T/2))*(int(0,-T/2,0)+int(1,0,T/2));a_n=(1/(T/2))*(int(0*cos(n*w*t),-T/2,0)+int(1*cos(n*w*t),0,T/2))b_n=(1/(T/2))*(int(0*sin(n*w*t),-T/2,0)+int(1*sin(n*w*t),0,T/2))fx=a0/2+symsum(a_n*cos(
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/28 05:40:49
![matlab 用变量替换表达式syms w t nsyms T positive;a0=(1/(T/2))*(int(0,-T/2,0)+int(1,0,T/2));a_n=(1/(T/2))*(int(0*cos(n*w*t),-T/2,0)+int(1*cos(n*w*t),0,T/2))b_n=(1/(T/2))*(int(0*sin(n*w*t),-T/2,0)+int(1*sin(n*w*t),0,T/2))fx=a0/2+symsum(a_n*cos(](/uploads/image/z/955346-50-6.jpg?t=matlab+%E7%94%A8%E5%8F%98%E9%87%8F%E6%9B%BF%E6%8D%A2%E8%A1%A8%E8%BE%BE%E5%BC%8Fsyms+w+t+nsyms+T+positive%3Ba0%3D%281%2F%28T%2F2%29%29%2A%28int%280%2C-T%2F2%2C0%29%2Bint%281%2C0%2CT%2F2%29%29%3Ba_n%3D%281%2F%28T%2F2%29%29%2A%28int%280%2Acos%28n%2Aw%2At%29%2C-T%2F2%2C0%29%2Bint%281%2Acos%28n%2Aw%2At%29%2C0%2CT%2F2%29%29b_n%3D%281%2F%28T%2F2%29%29%2A%28int%280%2Asin%28n%2Aw%2At%29%2C-T%2F2%2C0%29%2Bint%281%2Asin%28n%2Aw%2At%29%2C0%2CT%2F2%29%29fx%3Da0%2F2%2Bsymsum%28a_n%2Acos%28)
matlab 用变量替换表达式syms w t nsyms T positive;a0=(1/(T/2))*(int(0,-T/2,0)+int(1,0,T/2));a_n=(1/(T/2))*(int(0*cos(n*w*t),-T/2,0)+int(1*cos(n*w*t),0,T/2))b_n=(1/(T/2))*(int(0*sin(n*w*t),-T/2,0)+int(1*sin(n*w*t),0,T/2))fx=a0/2+symsum(a_n*cos(
matlab 用变量替换表达式
syms w t n
syms T positive;
a0=(1/(T/2))*(int(0,-T/2,0)+int(1,0,T/2));
a_n=(1/(T/2))*(int(0*cos(n*w*t),-T/2,0)+int(1*cos(n*w*t),0,T/2))
b_n=(1/(T/2))*(int(0*sin(n*w*t),-T/2,0)+int(1*sin(n*w*t),0,T/2))
fx=a0/2+symsum(a_n*cos(n*w*t)+b_n*sin(n*w*t),n,1,35);
这是个方波的傅里叶展开
以下是结果:
a0 =
1
a_n =
(2*sin((T*n*t)/2))/(T*n*t)
b_n =
(4*sin((T*n*t)/4)^2)/(T*n*t)
我想令a_n和b_n表达式里的T*n都等于2*pi,
matlab新手,
matlab 用变量替换表达式syms w t nsyms T positive;a0=(1/(T/2))*(int(0,-T/2,0)+int(1,0,T/2));a_n=(1/(T/2))*(int(0*cos(n*w*t),-T/2,0)+int(1*cos(n*w*t),0,T/2))b_n=(1/(T/2))*(int(0*sin(n*w*t),-T/2,0)+int(1*sin(n*w*t),0,T/2))fx=a0/2+symsum(a_n*cos(
subs(a_n,'n*T','2*pi');
subs(b_n,'n*T','2*pi')