How to perform a proper interpolation with only few data points
16 次查看(过去 30 天)
显示 更早的评论
I want to interpolate the following data:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/159884/image.jpeg)
I was trying:
interpolation = interp1(frequency,linear scaling,'spline')
But this doesn't work well at all! Is there a better way?
0 个评论
采纳的回答
Star Strider
2017-1-17
You need a vector of independent values to interpolate. Note that the variable name ‘linear scaling’ (with the included space) is not a valid MATLAB variable name, and with the space would throw an error because there is no required comma (,) to separate the arguments. I added the underscore to rename it ‘linear_scaling’.
See if this improves your results:
freq_intrp = linspace(min(frequency), max(frequency), 50);
interpolation = interp1(frequency, linear_scaling, freq_intrp, 'spline');
I chose 50 points (third argument to linspace) between the frequency limits. Use as many points as you like.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!