求帮改MATLAB程序错误x0=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25];y0=[11 9 8 14 9.5 9 7.5 10.5 11 8 8.5 10.5 11 9.5 11 12.5 12 7.5 11.5 9 9 8.5 7 11 9.5 11];x=0:0.1:26;y4=interp1(x0,y0,x,'spline');plot(x0,y0,'+',x,y4
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/05 18:56:02
求帮改MATLAB程序错误x0=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25];y0=[11 9 8 14 9.5 9 7.5 10.5 11 8 8.5 10.5 11 9.5 11 12.5 12 7.5 11.5 9 9 8.5 7 11 9.5 11];x=0:0.1:26;y4=interp1(x0,y0,x,'spline');plot(x0,y0,'+',x,y4
求帮改MATLAB程序错误
x0=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25];
y0=[11 9 8 14 9.5 9 7.5 10.5 11 8 8.5 10.5 11 9.5 11 12.5 12 7.5 11.5 9 9 8.5 7 11 9.5 11];
x=0:0.1:26;
y4=interp1(x0,y0,x,'spline');
plot(x0,y0,'+',x,y4)
hold on
s=@(x)interp1(x0,y0,x,'spline');
for i=0:25
L(i)=quadl(s,0,i);
end
plot(y,L)
L
我想先进行拟合然后求出函数的积分 提示
Warning:Minimum step size reached; singularity possible.
> In quadl at 94
Subscript indices must either be real positive integers or logicals.
for i=0:25我改成for i=1:25了 可是算出来答案780个L.而且数值不对.都才0-2以内
求帮改MATLAB程序错误x0=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25];y0=[11 9 8 14 9.5 9 7.5 10.5 11 8 8.5 10.5 11 9.5 11 12.5 12 7.5 11.5 9 9 8.5 7 11 9.5 11];x=0:0.1:26;y4=interp1(x0,y0,x,'spline');plot(x0,y0,'+',x,y4
pp=spline(x0,y0);
s=@(x)ppval(pp,x);
for i=1:25
L(i)=quadl(s,0,i);
end
L是25个