From: Clemens on
Hei there,

i have a strange Problem, i tried to encapsulate my fitting procedure in a class, but i can not give a function handle to the Outputfcn of lsqcurvefit. I tried now to have the output function inline, as i used it before(it worked), as a seperate method of the class(as static and non-static), and as a new m file.

I always get the error message:

FUN must be a function handle; or, FUN may be a cell array that contains function handles.

But as i said it works outside of the class...

do i have to do something different to reference to the function in the class?

Greetings
Clemens
From: Steven Lord on

"Clemens " <greatevilhamster(a)web.de> wrote in message
news:hvrue0$824$1(a)fred.mathworks.com...
> Hei there,
>
> i have a strange Problem, i tried to encapsulate my fitting procedure in a
> class, but i can not give a function handle to the Outputfcn of
> lsqcurvefit. I tried now to have the output function inline, as i used it
> before(it worked), as a seperate method of the class(as static and
> non-static), and as a new m file.
>
> I always get the error message:
>
> FUN must be a function handle; or, FUN may be a cell array that contains
> function handles.
>
> But as i said it works outside of the class...
>
> do i have to do something different to reference to the function in the
> class?

No idea. A SMALL section of code showing the method names (and Access
properties) as well as how specifically you're trying to call LSQCURVEFIT
(along with your call to OPTIMSET) would be useful in debugging.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com


From: Clemens on
Hei,

when i was trying to make an example code, i recognized that its actually working...

The Problem was that the vectors for the initial values and boundaries in the lsqcurvefit function were empty....

But it gave me only the error message that the function handle is actually no function handle.

I'm sorry for asking stupid questions:)

Have a nice Day