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/11/15 04:07:57
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')