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?
댓글 수: 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.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!