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

조회 수: 2 (최근 30일)
Laura
Laura 2014년 1월 30일
답변: Sean de Wolski 2014년 1월 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