Internal math error when using interpolation

I am using MATLAB to process and evaluate reflection coefficients of antennas.
The data is saved and used as an Mx2 array, where the M is the length of the x-axis data points, (or sample points). The first coloumn contains the values of the frequency points and the second coloumn contains the corresponding reflection coefficient values.
I use the 'interp1' function, which worked for the arrays of length 501, but the other array sized, 402, 404, 408 and 505, the following error occurs:
Error using matlab.internal.math.interp1
Sample points must be unique and sorted in ascending order.
Error in interp1 (line 188)
VqLite = matlab.internal.math.interp1(X,V,method,method,Xqcol);
I checked, and my sample points are unique and in ascending order, but the error still persists.
Here is a little snippet of the data
Sample point Reflection coefficient value
200 0.979472485068518
204.500000000000 0.977219575869647
209 0.974701356449019
213.500000000000 0.971883119143293
218 0.968724759813479
222.500000000000 0.965179866285502
227 0.961194345460292
231.500000000000 0.956704944454534
236 0.951637259422883
240.500000000000 0.945903325003744
245 0.939398658119580
Any and all help will be greatly appreciated.

댓글 수: 2

Stephan
Stephan 2020년 12월 7일
Please provide the data
It appears that a sample point was duplicated when I first created the data.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

릴리스

R2020b

질문:

2020년 12월 7일

댓글:

2020년 12월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by