matlab最小二乘法拟合非线性函数出现报错:
错误使用 lsqcurvefit (line 251)
Function value and YDATA sizes are not equal.
出错 model160 (line 128)
x = lsqcurvefit(fun,x0,t,y)

不知道具体是哪里错了,请懂得小伙伴指教。如下:
clc;
clear all;
close all;
t =1:1:120;
y = [1.5209E-05
2.73925E-05
3.64347E-05
4.51801E-05
5.36917E-05
6.03408E-05
6.95839E-05
7.45523E-05
8.15452E-05
8.76574E-05
9.25562E-05
9.92101E-05
0.000103591
0.000109378
0.000114834
0.000119125
0.000124516
0.000128957
0.000134247
0.000139571
0.000142767
0.000148786
0.000152469
0.000156941
0.00016204
0.000165391
0.00017141
0.00017426
0.000178289
0.000183396
0.000186163
0.000191818
0.000194611
0.000199332
0.000203071
0.000206965
0.000211602
0.000214311
0.000219018
0.000222397
0.000225307
0.000230937
0.000233137
0.00023843
0.00024143
0.000245348
0.000250016
0.000253136
0.000257096
0.000261387
0.000264397
0.00026828
0.000271454
0.000275756
0.000279777
0.000282872
0.000288457
0.000290436
0.000295746
0.000298417
0.00030172
0.000306522
0.000308895
0.000313854
0.00031624
0.000321006
0.000324864
0.000328049
0.000332961
0.000335469
0.000340339
0.000344124
0.000348256
0.000352025
0.0003554
0.00036012
0.000362843
0.000367776
0.000371939
0.000374454
0.000379865
0.000382898
0.000387542
0.000392048
0.000394471
0.000400136
0.000403197
0.00040757
0.000412319
0.000415696
0.000421168
0.00042421
0.000428371
0.000433276
0.000437273
0.000441722
0.000445754
0.000450634
0.000453627
0.000458699
0.000462663
0.000466301
0.000472464
0.000475643
0.000479811
0.00048516
0.000489106
0.00049434
0.000498791
0.000503249
0.000508155
0.000513013
0.000518485
0.000522081
0.000528433
0.000533215
0.000537586
0.000543645
0.000547585
0.000553172];
k=0.4;
fun=@(x,t)(k*x (3).*(x(4).^(x (1) .*t+x (2)))) .*t.^(-x (1) .*t-x (2))./(gamma (1-x (1) .*t-x(2))) ;
x0 = [1,1,1,1];
x = lsqcurvefit(fun,x0,t,y)
times = linspace(t(1),t(end));
plot(t,y,'ko',times,fun(x,times),'b-')
legend('Data','Fitted exponential')
xlabel('x')
ylabel('y')
title('Data and Fitted Curve')
R2=1 - (sum((fun(x,t)- y).^2)/ sum((y - mean(y)).^2))
RMSE = sqrt(mean((fun(x,t)-y).^2))