求帮改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/07/15 04:34:32
![求帮改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](/uploads/image/z/1340368-16-8.jpg?t=%E6%B1%82%E5%B8%AE%E6%94%B9MATLAB%E7%A8%8B%E5%BA%8F%E9%94%99%E8%AF%AFx0%3D%5B0+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%5D%3By0%3D%5B11+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%5D%3Bx%3D0%3A0.1%3A26%3By4%3Dinterp1%28x0%2Cy0%2Cx%2C%27spline%27%29%3Bplot%28x0%2Cy0%2C%27%2B%27%2Cx%2Cy4)
求帮改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个