From: patrik osgnach on
Hi, is there a way to do an hyperbolic interpolation in matlab? i mean, i have some data and i know that a function like f(x)=c*x^-a fits my data very good. how can i find such a?
From: Torsten Hennig on
> Hi, is there a way to do an hyperbolic interpolation
> in matlab? i mean, i have some data and i know that a
> function like f(x)=c*x^-a fits my data very good. how
> can i find such a?

Create a matrix A with rows [1 -log(x_i)]
and a vector b with elements log(y(i))
where (x(i),y(i)) are the data to be approximated.
Then set p=A\b ; exp(p(1)) = c and p(2)=a in your
equation above.

I linearized your equation f(x)=c*x^(-a) by taking
log on both sides ; if it is necessary to make
a nonlinear fit in the parameters, look for
lsqnonlin or lsqcurvefit.

Best wishes
Torsten.
From: patrik osgnach on
Torsten Hennig <Torsten.Hennig(a)umsicht.fhg.de> wrote in message <117634534.354860.1268207989229.JavaMail.root(a)gallium.mathforum.org>...
> > Hi, is there a way to do an hyperbolic interpolation
> > in matlab? i mean, i have some data and i know that a
> > function like f(x)=c*x^-a fits my data very good. how
> > can i find such a?
>
> Create a matrix A with rows [1 -log(x_i)]
how many rows? are the rows to be all equal?
From: Torsten Hennig on
> Torsten Hennig <Torsten.Hennig(a)umsicht.fhg.de> wrote
> in message
> <117634534.354860.1268207989229.JavaMail.root(a)gallium.
> mathforum.org>...
> > > Hi, is there a way to do an hyperbolic
> interpolation
> > > in matlab? i mean, i have some data and i know
> that a
> > > function like f(x)=c*x^-a fits my data very good.
> how
> > > can i find such a?
> >
> > Create a matrix A with rows [1 -log(x_i)]
> how many rows? are the rows to be all equal?

If (x(i),y(i)) are your measured data to be fitted
(i=1,...,n), create a matrix with n rows and 2 columns
where the rows have the form [1 -log(x(i)].

Best wishes
Torsten.
From: patrik osgnach on
>
> If (x(i),y(i)) are your measured data to be fitted
> (i=1,...,n), create a matrix with n rows and 2 columns
> where the rows have the form [1 -log(x(i)].
>
ah, ok. I misunderstood that [1 -log(x(i))]
now it works, thank you very much