数学建模社区-数学中国
标题:
求拟合代码
[打印本页]
作者:
woshiluyu666
时间:
2013-5-18 13:34
标题:
求拟合代码
t=[1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,31,32,35,37,39,47];
! ~. u. k' J. e7 r% _( k: d0 @
x=[3,7,8,12,15,16,19,22,26,31,36,41,47,58,61,75,80,85,89,90,94,102,102,108,112,114,116,121,124,126,128,128,130,131];
( k. M' g( U5 V; ]' e
plot(t,x,'*')
+ a X8 f% ~/ t: B
b0=[0.46,5.3,-0.45];
& s) |) ^4 P! a0 ?
fun=inline('b(1)/(1+b(2)*exp(b(3)*t))','b','t');
, }1 b5 I8 J ~/ y r8 D
[b,r,j]=nlinfit(t,x,fun,b0);
9 n1 n9 I6 j& S1 s
b
7 O' c& \% a: ]/ m5 ^: ]
。。
' W' O" ]; E! S0 b
请问大神们,为什么老是出现错误呢,麻烦帮我检查fun=inline('b(1)/(1+b(2)*exp(b(3)*t))','b','t');
0 F% g: V n+ B8 v/ h( j5 `* L+ T1 s
这句哪儿出错了,急求。。
作者:
madio
时间:
2013-8-20 17:49
t=[1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,31,32,35,37,39,47];
( d% a9 ^8 \3 h3 D. h
x=[3,7,8,12,15,16,19,22,26,31,36,41,47,58,61,75,80,85,89,90,94,102,102,108,112,114,116,121,124,126,128,128,130,131];
- o9 s' I- k& T; {
plot(t,x,'*');
, T7 U- z: s" F# g" b
b0=[0.46,5.3,-0.45];
( G# _* ^6 n- j3 _6 k0 D6 t7 S& R
fun=inline('b(1)./(1+b(2)*exp(b(3)*t))','b','t');
( d3 m% [! z( S2 w' ~
[b,r,j]=nlinfit(t,x,fun,b0);
- t; q$ |) n+ J
b
复制代码
改了一下,你试试看
/ _& U, j. K Y/ B/ F, C' T
作者:
净心、精心
时间:
2013-8-20 20:17
fun=inline('b(1)./(1+b(2)*exp(b(3)*t))','b','t');换成点除
欢迎光临 数学建模社区-数学中国 (http://www.madio.net/)
Powered by Discuz! X2.5