24小时热门版块排行榜    

查看: 496  |  回复: 2

zajage

金虫 (著名写手)

[求助] 请高手看看:这个MATLAB程序那里不妥?

从书上抄的程序,在软件上不能运行求指点!(书上也有不对的??)
>> t = 1900:10:1990;
p = [75.995 91.972 105.711 123.203 131.669...
150.697 179.323 203.212 226.505 249.633];
%使用不同的方法进行插值运算
x = 1900:0.01:1990;
yi_linear=interpl(t,p,x);
yi_spline=interpl(t,p,x, 'spline');
yi_cubic=interpl(t,p,x, 'cubic');
yi_v5cubic=interpl(t,p,x, 'v5cubic');
%绘制对比图形
subplot(2,1,1);
plot(t,p, 'ko');hold on;
plot(x,yi_linear, 'g', 'LineWidth',1.5);hold on
plot(x,yi_spline,'y', LineWidth',1.5);
grid on;
title('Linear Vs Splin');
subplot(2,1,2);
plot(t,p,'ko');hold on;
plot(x,yi_cubic,'m', 'LineWidth',1.5);hold on
plot(x,yi_v5cubic,'k',' LineWidth',1);
grid on;
title('Cubic Vs V5Cubic');
%创建新的图形窗口
figure
yi_nearest=interpl(t,p,x, 'nearest');
plot(t,p,ko');hold on;
plot(x,yi_nearest,'g', 'LineWidth',1.5);hold on
grid on;
title('Nearest Method')
??? Undefined function or method 'interpl' for input arguments of type 'double'.
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

change0618

铁杆木虫 (著名写手)

方丈大师


xiegangmai: 金币+1, 谢谢应助! 2012-05-24 23:26:59
不是interpl,是interp1,最后一个字符是1 2 3 4 的1,不是k l m n的l
2楼2012-05-24 16:41:31
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zajage

金虫 (著名写手)

臭水沟: , 右击帖子右下角“评分”即可给金币~ 2012-05-24 18:26:09
引用回帖:
2楼: Originally posted by change0618 at 2012-05-24 16:41:31:
不是interpl,是interp1,最后一个字符是1 2 3 4 的1,不是k l m n的l

差错真在这儿啊,谢谢!!
3楼2012-05-24 16:53:36
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 zajage 的主题更新
信息提示
请填处理意见