lhw123 发表于 2011-6-9 09:00

请各位学长 指教

swe=0.6803:0.001209:0.8 %swe-为出口端饱和度,范围为0.6803-0.8,有100个值
f=@(x)(7.74+1.2709./(3.5459*x.^4-6.4131*x.^3+5.5441*x.^2-4.1115*x+1.5713))/(1-(62.3224*x.^4-156.3326*x.^3+138.9387*x.^2-49.2614*x+6.0063));
%f为待积分的函数句柄
for j=1:60
   t(j)=548.19*quad(f,0.6791,swe(j));
end
%对swe中1到60个数据(共有100个数)分别积分,结果存在t中


结果出错:
??? Attempted to access y(7); index out of bounds because numel(y)=1.

Error in ==> quad at 70
if ~isfinite(y(7))

lhw123 发表于 2011-6-9 09:03

请学长们帮我看看错误多谢

ChaChing 发表于 2011-6-9 15:27

少了一点!
f=@(x)(7.74+1.2709./(3.5459*x.^4-6.4131*x.^3+5.5441*x.^2-4.1115*x+1.5713))./(1-(62.3224*x.^4-156.3326*x.^3+138.9387*x.^2-49.2614*x+6.0063));
页: [1]
查看完整版本: 请各位学长 指教