数学建模社区-数学中国

标题: 麻烦各位给看看这个问题 [打印本页]

作者: 卡卡之人    时间: 2011-11-21 21:14
标题: 麻烦各位给看看这个问题
t=[1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010];9 A  P1 \5 G' d! E
x=[566  632  745  755  769  789  985  1110 1313 1428 1782 1920 2150 2292 2601 3149 4338 5145 5809 6241 6854 7656 8772 10007 11374 12567 14332 16614 19228 22844 26404 29688 32074];& f. U1 s7 _6 Z" m
myfunc=inline('(566*beta(1))/(566*beta(2)+(beta(1)-566*beta(2))*exp(-beta(1)*(t-1978)))','beta','t');
1 M7 G7 a& u. z" {# D1 Bbeta=nlinfit(t,x,myfunc,[0 0]);
5 V0 Z/ T! a) s. ]: s3 ~9 ~% pa=beta(1),b=beta(2)0 M% D" {" d' x
%test the model
$ X+ e2 x/ d+ o7 Stt=min(X):max(x);
* c* S1 @) D0 {xx=(a-2*b*x)*(a-b*x)*x( R& f: F3 Q& L! a4 `1 ?# l
plot(t,x,‘0‘,t,xx,'r'); ]1 D& Z! `( Y) z. \, e
显示??? Error using ==> nlinfit at 1134 a' R' t' @+ z0 E7 u/ E3 ]) q
Error evaluating inline model function.
: h3 B3 @8 }8 A# m+ W- f+ d1 m' d- uCaused by:
4 B3 i2 O4 b5 F& L1 }    Error using ==> inlineeval at 152 Y1 e( d# x, i, _
    Error in inline expression ==> (566*beta(1))/(566*beta(2)+(beta(1)-566*beta(2))*exp(-beta(1)*(t-1978)))
$ r; f3 r( p6 F     Matrix dimensions must agree.不知道哪不对,求助




欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) Powered by Discuz! X2.5