How to use interp1 with different length?
3 次查看(过去 30 天)
显示 更早的评论
How to use interp1 with different length?
0 个评论
采纳的回答
Walter Roberson
2012-1-10
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 个评论
Walter Roberson
2012-1-17
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!