help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

polyfit with a fixed slope ??


From: Oisín Ó Cuanacháin
Subject: polyfit with a fixed slope ??
Date: Tue, 25 May 2010 13:20:34 +0100

Hi,

Does anyone know if there is a function to fit a line with a specified slope to some data. I have a load of data 'x' and
polyfit(1:length(x),x,1) gives me the best-fit line, with arbitrary slope.
What I want however is the best fit line with a particular slope. This is essentially just a minimization problem and I know I could code something up myself, but x has 100's of millions of elements I'm guessing my coding efforts will take forever to run, so does such a nice function already exist? It is essentially polyfit with an added constraint that the slope is fixed.

Thanks,

Oisín.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]