help-octave
[Top][All Lists]

## polyfit issue

 From: Georg P. Israel Subject: polyfit issue Date: Tue, 25 Jul 2006 15:37:05 +0200

```Dear Octave users,

it seems that polyfit does not work for me.
This is not a software issue, but it seems that I overlook some
mathematical issues.

I do have a function of the form of a polynome:

f(x)= a0+a1*x^1+...+a6*x^6

The function gets called with x:= X^2
Hence, the actual function is of the order of 13 with all odd elements
zero.

I like to find the inverse function to this function such that:

g(f(x)) = x

g(y) should be notated in the same form as f(x).
If I try to do this with a normal polynome where x:=X then the fitting
works fine. But when I try to do the same with x:=X^2 then this stuff
fails misserably. This means, the resulting approximated polynome is
very much different form the original.

Do I overlook something??

To be more specific:

x = [0:1:215];
f(x) = x .* polyval(a,x.^2);

now, I tried to find the g(y) that has the same form of a polynome as
f(x) but approximates the inverse of this function.

If I define f(x) = x .* polyval(a,x); and it's inverse similar then all
works fine. But if I use a power of two then all fails.

Has anybody an idea how to define this ???