How To Use Polunomial Interpolation?
1 回表示 (過去 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?
0 件のコメント
回答 (1 件)
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 件のコメント
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 Exchange で Polynomials についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!