Polynomial Fitting question [message #68144] |
Fri, 02 October 2009 01:40 |
Andrew Rodger
Messages: 5 Registered: October 2009
|
Junior Member |
|
|
Does anyone know of a way I can do the following and avoid the inner
loop (ignore the outer loop),
I have an input array of data that is11x512. I want to fit a
polynomial, or 512 of them to be precise, to the data such that I now
have 512 polynomial equations, or at least the coefficients for them.
e.g.
POLYFIT=FLTARR(3,512)
FOR t=0,Whatever DO BEGIN
FOR i=0,512 DO BEGIN
polyfit[*,i]=POLY_FIT(X,Y[ *,i],2)
ENDFOR
ENDFOR
As I say I do not need to concern myself with the outer loop as there
is a huge amount of other stuff going on outside of the inner loop
that is both cunning and amazing and staggeringly awesome. But the
fact that I have an inner loop is slowing down my processing no end
and is driving me crazy, plus it truly takes away from the
awesomeness.
I have had a look at Craig's MPFIT code etc and I don't think that it
is the solution I need (unless I have missed something: Not unusual
for me at all). Maybe one does not exist.
Any help is appreciated
Cheers
Andrew
|
|
|