How To Use Polunomial Interpolation?

2 次查看(过去 30 天)
Hi. I have a big problem. I wanna normalize some sub-sequences with varied length into identical length by the Polynomial Interpolation. my data is some 0 and 1 that are put in a structure.
For instance: Chromosome.Position=[1001][10101][101][100001]....
Could anyone help me?

回答(1 个)

John D'Errico
John D'Errico 2014-9-4
编辑:John D'Errico 2014-9-4
I think you need to either explain what you mean by interpolation in this context, or figure out what you mean yourself, as it is completely unclear how you intend to interpolate such a sequence. Very often when someone asks a question that is so unclear, it means they do not themselves understand what they are trying to do.
That is, interpolation of integer values will tend to produce non-integers at intermediate points. What does a non-integer mean in this context? So is your goal to take the pair of sequences:
[1001] [10101]
and make them both of length 5? What would you expect to see?
  2 个评论
Zahra kamkar
Zahra kamkar 2014-9-5
Thanks so much for your reply. To be frank, I myself can't understand how I can use interpolation here! But as I said, I just need to make the length of my sequences identical. Its not important whether it becomes non-integer or not. Yes, I wanna make the length of all my sequences for example, 5.
John D'Errico
John D'Errico 2014-9-9
Anyway, polynomial interpolation is an INSANE idea here. Polynomials will tend to give numbers that are wildly outside the range [0,1], not even just non-integers. You are far better off using interp1 instead. I would suggest the linear method as simplest. For example...
P1 = [1 0 0 1];
X1 = linspace(1,5,numel(P1));
P1int = interp1(X1,P1,1:5)
P1int =
1 0.25 0 0.25 1
Which is as good as you can expect. Even so, The whole idea seems silly if these are suppose to be genetic in origin.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Polynomials 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by