Optimization toolbox error message

May 2010
hi everybody
I´m new in this forum.
What I would like to know is how can I fix an error on my Matlab program.
The program is a Finite element updating program for structural static analysis that controls Ansys and get the results to Matlab that optimizes it with an objective function.
The error message is about the objective function: The errors are:

End diagnostic information

??? Error using ==> c:/matlab6p5/toolbox/optim/private/nlconst
FUN must return a non-empty objective function.

Error in ==> C:\MATLAB6p5\toolbox\optim\fmincon.m
On line 458 ==> [X,FVAL,lambda,EXITFLAG,OUTPUT,GRAD,HESSIAN]=...

Error in ==> C:\hUGO_rar\exper33x.m
On line 206 ==> [x, fval, exitflag, output, lambda] = ...

My objective function code is defined as:

options = optimset('LargeScale','off','Display','iter','Diagnostics','on'...
[x, fval, exitflag, output, lambda] = ...

can you please tell me what might be wrong?
thanks and regards