MATLAB编程 帮忙看看那里错了 怎么不能运行啊 谢谢

[复制链接]
查看11 | 回复1 | 2011-3-19 06:18:52 | 显示全部楼层 |阅读模式
x=1:10;
y=[3.56 2.56 1.54 0.53 0.26 0.90 1.81 2.12 1.53 0.56];
pp1=csape(x,y,\'second\',[1 2]);
cc1=ppval(pp1,x);
pp2=csape(x,y,\'complete\',[1 2]);
cc2=ppval(pp2,x);
pp3=csape(x,y,\'not-a-knot\');
cc3=ppval(pp3,x);
pp4=csape(x,y,\'periodic\');
cc4=ppval(pp4,x);
subplot(2 2 1)plot(x,cc1,\'r\');
subplot(2 2 2)plot(x,cc2,\'r\');
subplot(2 2 3)plot(x,cc3,\'r\');
subplot(2 2 4)plot(x,cc4,\'r\');
回复

使用道具 举报

千问 | 2011-3-19 06:18:52 | 显示全部楼层
<pre id=\"best-answer-content\" class=\"reply-text mb10\">最后四行:
错误1:subplot(2,2,1)或者subplot(221) 而不是subplot(2 2 1);
可以用逗号或者不隔开,但是不能用空格。
错误2:subplot(2,2,1)后面要用分号。
改为:
subplot(2,2,1);plot(x,cc1,\'r\');
剩下的三行错误相同。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行