필터 지우기
필터 지우기

Alternative Methods for Interpolation or Solutions of Interpolation Errors

조회 수: 4 (최근 30일)
Volkan Yangin
Volkan Yangin 2015년 12월 6일
댓글: John D'Errico 2015년 12월 7일
Hi everbody.
Sometimes i give an error when making interpolation process for ex. "The values of X should be distinct error".
I have an exam this tuesday which will be done by matlab. And i am afraid of interpolation errors.
What are the alternative methods for interpolation or solutions of errors like "The values of X should be distinct" etc.?
Thanks a lot.

답변 (2개)

Walter Roberson
Walter Roberson 2015년 12월 7일
The available techniques depend a great deal upon whether the Y corresponding to the duplicate X are the same or different.
If the Y values are the same then the major technique is to unique() the X values and take the corresponding Y values. One way of doing that is to use
XY = [X(:), Y(:)];
uXY = unique(XY,'rows');
uX = uXY(:,1);
uY = uXY(:,2);
interp1(uX, uY, locations_to_interpolate_at)
But typically one would instead construct the X values to be unique.
What are some circumstances under which you have had difficulty with duplicate X values?

Volkan Yangin
Volkan Yangin 2015년 12월 7일
Thanks Walter Roberson for your answer.
For ex. my X values = [8.79 9.42 10.05 ...], these values are increasing but through to 900. column, X values decreasing to 0. My Y values haven't got standart tendency, for ex. [970 971 2394 972 ...]. When i use the interp1 command for ex. interp1(X,Y,25.45) etc, i encounter this error. I have some duplicate values of X but not Y.
  댓글 수: 3
Volkan Yangin
Volkan Yangin 2015년 12월 7일
Thank you Walter Roberson. If i will encounter like this interpolation errors in exam or other projects, i will use your splitting methods.
John D'Errico
John D'Errico 2015년 12월 7일
Please do not add answers every time you wish to comment. Use the COMMENTS!!!!!!!!

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

카테고리

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