MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   求高手指教!The input character is not valid in MATLAB statements or expressions (https://www.labfans.com/bbs/showthread.php?t=9755)

289zm257 2009-09-24 20:20

求高手指教!The input character is not valid in MATLAB statements or expressions
 
我刚学MATLAB,有个程序错了不知道怎么改,青高手帮忙改下。谢谢!
>> x=[3.471 3.570 4.372 4.539 4.990 5.459 5.750];
y=[638.3 640.2 650.6 653.2 659.9 667.8 671.7];
xi=3.7:0.1:5.5;
xH=4.740;
ycubic=interp1(x,y,’cubic’);
yH1=interp1(x,y,xH,’cubic’)
plot(x,y,’*’,xH,yH1,’o’,xi,ycubic,’-‘)
??? ycubic=interp1(x,y,’cubic’);
|
Error: The input character is not valid in MATLAB statements or expressions.还有图像要求有格子,要添加一句,怎么处理。谢谢!

cqxuiit 2009-10-04 11:44

回复: 求高手指教!The input character is not valid in MATLAB statements or expressions
 
1. 检查你的程序中的符号是否是在英文状态下输入的;
2. 添加网格: 在Plot语句后,加上grid on 即可

xintaolv 2009-10-16 15:58

回复: 求高手指教!The input character is not valid in MATLAB statements or expressions
 
你的interp1(x,y,'cubic')中少了一个参数的输入,我看应该改为interp1(x,y,xi,'cubic'),改后你再试一下。
Good luck!


所有时间均为北京时间。现在的时间是 18:16

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.