Interpolating 3D Gridded data at specific cordinates

1 回表示 (過去 30 日間)
Mark
Mark 2022 年 11 月 22 日
コメント済み: Mark 2022 年 11 月 22 日
I am working with 3D gridded data with a dimension of (Longitude,Latitude,Height) and size (73x37x41). I want to plot temperature vs longitude at a slice of latitude = 0 degree and Height at 100 km and also temperature vs latitude at a slice of longitude = 0 degrees and height = 100 km.The original data does not provide data at these specific point i.e ( latitude = 0 and height = 100 km and longitude= 0 degree and height = 100 km). I know I have to interpolate my data to plot at these specific point but I am having problem in interpolating.
My data is something like this
[Long,Lat,Height] = ndgrid(0:5:360,-90:5:90,0:15:600);
Temp = rand(73,37,41)*1000;

採用された回答

Matt J
Matt J 2022 年 11 月 22 日
編集済み: Matt J 2022 年 11 月 22 日
[Long,Lat,Height] = deal(0:5:360,-90:5:90,0:15:600); %Fake data
Temp = rand(73,37,41)*1000;
LUT=griddedInterpolant({Long,Lat,Height}, Temp); %interpolation object
TempvLong=LUT({0,Long,100}); %slices
TempvLat=LUT({Lat,0,100});
figure(1)
plot(Long(:),TempvLong(:));
xlabel 'Longitude'; ylabel 'Temperature'
figure(2);
plot(Lat(:),TempvLat(:));
xlabel 'Latitude'; ylabel 'Temperature'
  6 件のコメント
Matt J
Matt J 2022 年 11 月 22 日
Both 100 and 500 are well outside the range of Alt values given, and are in different units, so LUT is just doing meaningless extrapolation.
>> mnmx(Alt)
Maximum entry = 664122.1875
Minimum entry = 96420.9922
NaNs Present = NO
Mark
Mark 2022 年 11 月 22 日
Thanks, @Matt J. I figured out where I was wrong.

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

その他の回答 (0 件)

カテゴリ

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