フィルターのクリア

Date Interpolation, getting erro

5 ビュー (過去 30 日間)
Veronica Vigil
Veronica Vigil 2023 年 10 月 23 日
コメント済み: Walter Roberson 2023 年 10 月 27 日
Hello! Someone a few months ago helped me interpolate data. I need to re-interpolate, and I am getting the following error:
Error using griddedInterpolant
Sample points must be sorted in ascending order.
>> InterpdatatableFlux
Error using griddedInterpolant
Sample points must be sorted in ascending order.
Error in interp2>makegriddedinterp (line 226)
F = griddedInterpolant(varargin{:});
Error in interp2 (line 134)
F = makegriddedinterp(X, Y, V, method,extrap);
Error in InterpdatatableFlux (line 18)
Ai = interp2(Xu,Yu,A,Xi,Yi);
Here's what I need:
I need this to interpolate the flux values between 0 and 10, 10 and 20...etc, and then between 300 and 310, and 310 and 320...etc. Only thing I changed from when it was working is the values have reduced (they were never in order), and added from 1200 to 1300.
Attached FluxData3 is the NEW data I need to interpolate. Also attached is my m file.
As I said, I had this working with old data and now it won't work or even plot. Help!!!???

採用された回答

Walter Roberson
Walter Roberson 2023 年 10 月 23 日
You have
yvar = T1{2:end,2};
That should be
yvar = T1{2:end,1};
  2 件のコメント
Veronica Vigil
Veronica Vigil 2023 年 10 月 27 日
Thanks @Walter Roberson! That really helped my plot. I was getting a really funky plot. Last question, you may or may not know. My data has 1,10,20....180. My code (the previously attached) is only interpolating from 10, 20,...180. It's not interpolating from 0 to 10. Ideas?
Walter Roberson
Walter Roberson 2023 年 10 月 27 日
interp2() returns NaN for query points that are outside of the triagulation of the input points.
If you were to use griddedInterpolant or scatteredInterpolant instead of interp2() then you would be able to specify an extrapolation method.

サインインしてコメントする。

その他の回答 (1 件)

Veronica Vigil
Veronica Vigil 2023 年 10 月 23 日
nevermind!! I think I got it.....

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by