필터 지우기
필터 지우기

Interpolating 3D Gridded data at specific cordinates

조회 수: 2 (최근 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 CenterFile Exchange에서 Author Block Masks에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by