FuncFit Error Flag?

I am writing a macro that runs through a number of files and fits them to a number of user-defined functions. This all works great except when the function returns an error of

**** Singular matrix error during curve fitting ****

which I know means that the equation has too many parameters and one is ill defined. (I'm fitting single exponentials versus double exponentials).

Unfortunately, this singular matrix error crashes my whole macro, when what I'd really like it to do is to generate an error message (that I can redirect somewhere), and continue with the next fit in the macro. It seems like there should be a flag whose status I can check before the macro crashes so that I can skip over the crash part.
Is this making sense?

Thanks,
-Karen f.
Execute the following command from the Igor command line:
DisplayHelpTopic "V_FitError and V_FitQuitReason"

This might need to be done from a function instead of a macro, but I think it should also work from a macro.
leandract wrote:
I am writing a macro that runs through a number of files and fits them to a number of user-defined functions. This all works great except when the function returns an error of

**** Singular matrix error during curve fitting ****

which I know means that the equation has too many parameters and one is ill defined. (I'm fitting single exponentials versus double exponentials).

Unfortunately, this singular matrix error crashes my whole macro, when what I'd really like it to do is to generate an error message (that I can redirect somewhere), and continue with the next fit in the macro. It seems like there should be a flag whose status I can check before the macro crashes so that I can skip over the crash part.
Is this making sense?

Thanks,
-Karen f.


Thank you, Adam.

Karen, you may also want the V_fitOptions variable:

Variable V_fitOptions=4
... the loop that does the fitting ...

This will suppress the curve fit progress window that keeps flashing. It will substantially speed up the loop. If you really have written a macro instead of a function, you may find that making it a function speeds things up quite a bit.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
English_Lab wrote:
I had the same problem and the V_FitError variable does work for a macro.


V_FitError works for a macro, but a loop in a macro is very slow. You're better off writing a function.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com