How to Extrapolate griddata for contour plot?
Show older comments
I have xy-grid with corresponding contour values which I intend to plot in a contour.
my x-grid and y-grid values are at dimensions 0:20:120 and 0:20:220, respectively.
load('xyref.mat')
I interpolated these values at grid of 10 units in xy direction using the contour value using meshgrid
load('contr.mat')
[x1,y1] = meshgrid(0:10:120, 0:10:220);
za = griddata(x,y,contr,x1,y1);
figure
[c,h] = contourf(x1,y1,za,'ShowText','on',FaceAlpha=1,EdgeAlpha=0.5,EdgeColor='k',LevelStep=5);
grid on
Now, at this point, I want to extrapolate these contour values to further 20 units range in both directions. I have already extracted these data of huge magnitude and it would take immense time in extrapolating these data. What I want to do is just linearly extrapolate these contours in the range -20 to 140 and -20 to 240 in x and y directions. Is there a way to extrapolate the griddata to those values?
Right now, the graph, when extrapolated gives nan values in the griddata and plots like this
[x1,y1] = meshgrid(-20:10:140, -20:10:240);
zb = griddata(x,y,contr,x1,y1);
figure
[c2,h2] = contourf(x1,y1,zb,'ShowText','on',FaceAlpha=1,EdgeAlpha=0.5,EdgeColor='k',LevelStep=5);
grid on
I hope I have explained my problem adequately. Your help in extrapolating griddata will be much appreciated. Thanks in advance and have a great weekend.
Accepted Answer
More Answers (0)
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


