Question re Loren (on the Art of Matlab) Data Driven Fitiing

2 次查看(过去 30 天)
Hi,
I´m using Loren's mylowess.m matlab code in MATLAB 2013a version. The thing is that I keep on getting the following error when I write exactly the same example that are on your post Data Driven Fitting:
Error using crossval>evalFun (line 480)
The function '@(train,test)norm(test(:,2)-mylowess(train,test(:,1),spans(j)))^2' generated the following error:
Undefined function or variable 'X'.
Error in crossval>getFuncVal (line 497)
funResult = evalFun(funorStr,arg(:));
Error in crossval (line 343)
funResult = getFuncVal(1, nData, cvp, data, funorStr, []);
Error in prueba_mylowess (line 60)
sse(j) = sum(crossval(f,[X,noisy],'partition',cp));
But when I use an older version of MATLAB (v.2011b) everything goes fine. Are there any changes in crossval code or in horzcat code?? why it is not working in the Matlab´s new version??
Waiting for your reply and thank you very much
Laura

回答(2 个)

Bjorn Gustavsson
Bjorn Gustavsson 2014-1-30
I managed to run through that example without problems in 2013a.

Sean de Wolski
Sean de Wolski 2014-1-30
Run:
dbstop if error
And then run the erroring code. This will stop with the debugger on the offending line and you'll be able to see where you are which will help you identify why X is not defined.

类别

Help CenterFile Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by