09-13-2007 09:29 AM
09-13-2007 04:30 PM
09-14-2007 03:40 AM
10-18-2007 03:02 AM
Hi there,
I have about the same problem using a fitting procedure in MathScript in LabVIEW. The error I get is:
Error code: 1050
LabVIEW: Error occurred while executing script. Error message from server: ??? Error using ==> optim\private\lsqncommon at 98
LSQNONLIN cannot continue because user supplied objective function failed with the following error:
Error using ==> feval
Undefined function or method 'fitfunctiepsidelta' for input arguments of type 'double'.
Error in ==> lsqnonlin at 181
[x,Resnorm,FVAL,EXITFLAG,OUTPUT,LAMBDA,JACOB] = ...
.
in psidelta.vi->ellipsfront.vi
Using the script
for i=1:length(En)
a=agem(i);
b=bgem(i);
gam=gamma(i);
P=Pp(i)*pi/180;
Pp(i)=P;
if i==1
c=[(45*pi/180) 0];
else
c=cc;
end
cl=[0 0];
cu=[(180*pi/180) (180*pi/180)];
options =optimset('TolX' ,0.000001);
fitnaam='@fitfunctiepsidelta';
[cc,resnorm,residual,exitflag,output,lambda,jacobian]=lsqnonlin(@fitfunctiepsidelta,c,cl,cu,options);
%varcovar=inv(jacobian'*jacobian)*resnorm
psideltavalues(i,2)=cc(1);
psideltavalues(i,3)=cc(2);
end
where i now use fitnaam as an input string, as '@fitfunctiepsidelta' didn't work as an input directly as well. Could you tell me what i am doing wrong here?
Thanks in advance,
Pepijn
11-02-2007 12:17 PM