>> x=[1:1:10];
>> y=[2:2:20];
>> x1=x;
>> y1=interp1(x,y,x1,'spline')
y1 =
2 4 6 8 10 12 14 16 18 20
然后怎样将所求得的函数表达式表示出来?
谢谢!
首先,谢谢!
我在运行上边程序时遇到如下问题,麻烦再帮我解答下,谢谢!
>> pp=interp1(x,y,x1,'spline','pp')
??? In an assignment A(matrix,:) = B, the number of elements in the subscript of A and
the number of rows in B must be the same.
Error in ==> F:\mtlab6.5\toolbox\matlab\polyfun\interp1.m
On line 218 ==> v(p(k),:) = extrapval;
而 >> pp=interp1(x,y,x1,'spline')
pp =
2 4 6 8 10 12 14 16 18 20
可以正常运行。