필터 지우기
필터 지우기

How to perform a proper interpolation with only few data points

조회 수: 9 (최근 30일)
Luki
Luki 2017년 1월 17일
댓글: Star Strider 2017년 1월 17일
I want to interpolate the following data:
I was trying:
interpolation = interp1(frequency,linear scaling,'spline')
But this doesn't work well at all! Is there a better way?

채택된 답변

Star Strider
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개)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by