Filter löschen
Filter löschen

Interpolation from coarse to fine grid

10 Ansichten (letzte 30 Tage)
Kenneth Roman
Kenneth Roman am 19 Sep. 2018
Kommentiert: Kenneth Roman am 24 Sep. 2018
Hello. I am trying to do the following. I need to evaluate two functions on the vertices of a uniform 5 x 5 grid and store them. Next , I need to decompose that grid into 2 overlapping sub-grids containing 24 points each. The first containing 24 points (1-24) where the first point is on the lower left hand corner. The second containing 24 points (18-36). How do I do in MATLAB?

Antworten (1)

ANKUR KUMAR
ANKUR KUMAR am 20 Sep. 2018
Hope this helps. The below code convert data over finer grids as well as it does vertical interpolation too.
lat=[65:1:75];
lon=[0:1:15];
data_lev1=randi(32,16,11);
lat_req=[65:0.5:75];
lon_req=[0:0.5:15];
%for interpolating over on finer grids
[lat_req_mesh,lon_req_mesh]=meshgrid(lat_req,lon_req);
for kk=1:size(lat_req_mesh,2)
data_lev1_finer(:,kk)=interp2(lat,lon,data_lev1,lat_req_mesh(:,kk),lon_req_mesh(:,kk));
end
data_lev2_finer=randi(32,31,21);
data_lev12=cat(3,data_lev1_finer,data_lev2_finer);
size(data_lev12)
%for interpolating over vertical levels. data_lev12 contains lat, lon and 2
%levels. If you wish to interpolate over 5 levels, then use following code
[lat_req_mesh,lon_req_mesh,vert_levs]=meshgrid(lat_req,lon_req,1:15);
data_lev12_vert=interp3(lat_req,lon_req,[1,24],data_lev12,lat_req_mesh,lon_req_mesh,vert_levs);
size(data_lev12_vert)
  1 Kommentar
Kenneth Roman
Kenneth Roman am 24 Sep. 2018
Thank you. I am not sure if this is exactly what I need. I am trying to reproduce the results of using MQ interpolation on two test functions from a paper by Kansa for a class project. I have attached an image from the paper on what I need to do and outlined it in pencil. Thank you.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Interpolation finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by