MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB基础] 求高手帮忙查个小错 (https://www.labfans.com/bbs/showthread.php?t=8758)

alee817 2009-06-01 19:50

求高手帮忙查个小错
 
clear;clc;
x=[-150 -100 -50 0 50 70 100 150 200 250];
y=[0 0.01 0.28 0.56 0.78 0.8 0.65 0.45 0.1 0];
myfunc=inline('0.98*0.1683*exp(sqrt(pi)*x*beta(1)/321.9)-exp(sqrt(pi)*beta(2)/279.3*(x-(200-beta(3)-beta(4))*sin(beta(5)+10)/sin(beta(5))))','beta','x');
beta=nlinfit(x,y,myfunc,[2 2 15 15 30]);
j=beta(1),k=beta(2),s1=beta(3),s2=beta(4),p=beta(5)
%test the model
xx=min(x):max(x);
yy=0.98*0.1683*exp(sqrt(pi)*x*j/321.9)-exp(sqrt(pi)*k/279.3*(x-(200-s1-s2))*sin(p+10)/sin(p)));
plot(x,y,'o',x,yy,'r')

运行时告诉我缺失符号。
??? Error: File: e:\MATLAB6p5\work\shao1.m Line: 9 Column: 94
Missing operator, comma, or semicolon.

TTT_IOU 2009-06-01 21:31

回复: 求高手帮忙查个小错
 
yy行最后多一')'


所有时间均为北京时间。现在的时间是 06:25

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