How to use interp1 with different length?
1 view (last 30 days)
Show older comments
How to use interp1 with different length?
0 Comments
Accepted Answer
Walter Roberson
on 10 Jan 2012
The idea of using interp1 is obviously slowing you down, so use a different method.
MappedX = ((X - OldRangeMin) / (OldRangeMax - OldRangeMin) * (NewRangeMax - NewRangeMin) + NewrangeMin;
But to answer your question: you do not use different X and Y lengths: you use the same lengths, even if they represent different interval widths.
MappedX = interp1([OldRangeMin OldRangeMax], [NewRangeMin NewRangeMax], X);
2 Comments
Walter Roberson
on 17 Jan 2012
Do you want the question addressed here or in your newer question http://www.mathworks.com/matlabcentral/answers/26268-can-you-help-me-how-to-interpolate-data-in-the-excel-table
More Answers (0)
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!