フィルターのクリア

How To Use Polunomial Interpolation?

2 ビュー (過去 30 日間)
Zahra kamkar
Zahra kamkar 2014 年 9 月 4 日
コメント済み: John D'Errico 2014 年 9 月 9 日
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 Center および File ExchangePolynomials についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by