标题:matlab编程回归模型中出现错误,望指点一下!
只看楼主
superbblue
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-8-9
 问题点数:0 回复次数:0 
matlab编程回归模型中出现错误,望指点一下!
%model.m文件
function yy = model(beta0,X)
a = beta0(1);
b = beta0(2);
c = beta0(3);
d = beta0(4);
e = beta0(5);
f = beta0(6);
x1 = X(:,1);
x2 = X(:,2);
x3 = X(:,3);
x4 = X(:,4);
x5 = X(:,5);
x6 = X(:,6);
yy = a*x1+b*x2+c*x3+d*x4+e*x5+f*x6;
%liti6.m文件
X= [598.00 349.00 461.00 57482.00 20729.00 44.00
586.00 455.00 475.00 58796.00 21364.00 89.00
707.00 520.00 491.00 60266.00 21832.00 97.00
737.00 558.00 529.00 61465.00 22328.00 98.00
825.00 715.00 556.00 62828.00 23018.00 150.00
837.00 798.00 575.00 64653.00 23711.00 139.00
1028.00 1235.00 598.00 65994.00 26600.00 256.00
1114.00 1681.00 509.00 67207.00 26173.00 338.00
1079.00 1870.00 444.00 66207.00 25880.00 380.00
757.00 1156.00 434.00 65859.00 25590.00 138.00
677.00 964.00 461.00 67295.00 25110.00 66.00
779.00 1046.00 514.00 69172.00 26640.00 85.00
943.00 1250.00 584.00 70499.00 27736.00 129.00
1152.00 1581.00 632.00 72538.00 28670.00 175.00
1322.00 1911.00 687.00 74542.00 29805.00 212.00
1249.00 1647.00 697.00 76368.00 30814.00 156.00
1187.00 1565.00 680.00 78534.00 31915.00 127.00
1372.00 2101.00 688.00 80671.00 33225.00 207.00
1638.00 2747.00 767.00 82992.00 34432.00 312.00
1780.00 3156.00 790.00 85229.00 35620.00 355.00
1833.00 3365.00 789.00 87177.00 35854.00 354.00
1978.00 3684.00 855.00 89211.00 36652.00 374.00
1993.00 3696.00 891.00 90859.00 37369.00 393.00
2121.00 4254.00 932.00 92421.00 38168.00 462.00
2052.00 4309.00 955.00 93717.00 38834.00 443.00
2189.00 4925.00 971.00 94974.00 39377.00 454.00
2475.00 5590.00 1058.00 96259.00 39856.00 550.00
2702.00 6065.00 1150.00 97542.00 40581.00 564.00
2791.00 6592.00 1194.00 98705.00 41896.00 568.00
2927.00 6862.00 1273.00 100072.0 43280.00 496.00];
y=[184.00 216.00 248.00 254.00 268.00 286.00 357.00 444.00 506.00...
271.00 230.00 266.00 323.00 393.00 466.00 352.00 303.00 447.00...
564.00 638.00 658.00 691.00 655.00 692.00 657.00 723.00 922.00...
890.00 826.00 810.0];
beta0 = [0.50 -0.03 -0.60 0.01 -0.02 0.35];
betafit = nlinfit(X,y,'model',beta0)
运行出现如下错误:Error in ==> liti6 at 36
betafit= nlinfit(X,y,'model',beta0)
??? Error using ==> nlinfit
MODELFUN should return a vector of fitted values the same length as Y.
望那位高手能够改一下!
搜索更多相关主题的帖子: matlab 模型 
2006-08-09 10:41



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-82949-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.078524 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved