matlab 积分>> w=linspace(0.3434,2.2196,80);>> t=1:1000;>> for i=1:1000syms xy(i)=int('x.*(-1.61.*sum((0.1276./w.^5.*exp(-0.0018./w.^4).*0.0238).^0.5.*w.^2.*cosh((w.^2./235.2).^0.5.*x)./sinh((w.^2./235.2).^0.5.*24).*(sin(w*t(i)+2*pi*rand()))))',x,0,
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/01 07:13:35
![matlab 积分>> w=linspace(0.3434,2.2196,80);>> t=1:1000;>> for i=1:1000syms xy(i)=int('x.*(-1.61.*sum((0.1276./w.^5.*exp(-0.0018./w.^4).*0.0238).^0.5.*w.^2.*cosh((w.^2./235.2).^0.5.*x)./sinh((w.^2./235.2).^0.5.*24).*(sin(w*t(i)+2*pi*rand()))))',x,0,](/uploads/image/z/11588994-18-4.jpg?t=matlab+%E7%A7%AF%E5%88%86%3E%3E+w%3Dlinspace%280.3434%2C2.2196%2C80%29%3B%3E%3E+t%3D1%3A1000%3B%3E%3E+for+i%3D1%3A1000syms+xy%28i%29%3Dint%28%27x.%2A%28-1.61.%2Asum%28%280.1276.%2Fw.%5E5.%2Aexp%28-0.0018.%2Fw.%5E4%29.%2A0.0238%29.%5E0.5.%2Aw.%5E2.%2Acosh%28%28w.%5E2.%2F235.2%29.%5E0.5.%2Ax%29.%2Fsinh%28%28w.%5E2.%2F235.2%29.%5E0.5.%2A24%29.%2A%28sin%28w%2At%28i%29%2B2%2Api%2Arand%28%29%29%29%29%29%27%2Cx%2C0%2C)
matlab 积分>> w=linspace(0.3434,2.2196,80);>> t=1:1000;>> for i=1:1000syms xy(i)=int('x.*(-1.61.*sum((0.1276./w.^5.*exp(-0.0018./w.^4).*0.0238).^0.5.*w.^2.*cosh((w.^2./235.2).^0.5.*x)./sinh((w.^2./235.2).^0.5.*24).*(sin(w*t(i)+2*pi*rand()))))',x,0,
matlab 积分
>> w=linspace(0.3434,2.2196,80);
>> t=1:1000;
>> for i=1:1000
syms x
y(i)=int
('x.*(-1.61.*sum((0.1276./w.^5.*exp(-0.0018./w.^4).*0.0238).^0.5.*w.^2.*cosh((w.^2./235.2).^0.5.*x)./sinh((w.^2./235.2).^0.5.*24).*(sin(w*t(i)+2*pi*rand()))))',x,0,24)
end
plot(t,y)
目的是y(i)在[0,24]上对x积分 但怎么输入end后没有“》”了?问问怎么回事,
matlab 积分>> w=linspace(0.3434,2.2196,80);>> t=1:1000;>> for i=1:1000syms xy(i)=int('x.*(-1.61.*sum((0.1276./w.^5.*exp(-0.0018./w.^4).*0.0238).^0.5.*w.^2.*cosh((w.^2./235.2).^0.5.*x)./sinh((w.^2./235.2).^0.5.*24).*(sin(w*t(i)+2*pi*rand()))))',x,0,
1、你把被积分表达式写成字符串,w的值不可能起作用;
2、积分很难求出解析表达式,而既然是计算定积分,就没必要(也没办法)用int,使用数值积分函数quadl为宜.
参考代码:
w=linspace(0.3434,2.2196,80);t=1:1000;
for i=1:1000
syms x
f=x.*(-1.61.*sum((0.1276./w.^5.*exp(-0.0018./w.^4).*0.0238).^0.5.*w.^2.*cosh((w.^2./235.2).^0.5.*x)./sinh((w.^2./235.2).^0.5.*24).*(sin(w*t(i)+2*pi*rand()))));
y(i)=quadl(@(x)subs(f,x),0,24);
end
plot(t,y)
结果: