extrapolate values from matrices and graphs

I have a chart of this type which derives from this script:
for i=1:length(longrd)
for j=1:length(latgrd)
XX(i,j)=longrd(i);
YY(i,j)=latgrd(j);
isel1=find(lonlatgrd(:,1)==longrd(i));
isel2=find(lonlatgrd(isel1,2)==latgrd(j));
isel=isel1(isel2);
ZZ(i,j)=prob(isel);
end
end
contourf(XX,YY,ZZ,500,'linecolor','none');
colormap jet
hold on
load coastlines.mat
geoshow(coastlat,coastlon,'color','k');
hold on
lonP = 14.2;
latP = 40.8;
plot(lonP,latP,'bo');
hold on
lonP_t= 13.5;
latP_t= 41.9;
plot(lonP_t,latP_t,'ro');
xlim([min(longrd), max(longrd)]);
ylim([min(latgrd), max(latgrd)]);
colorbar;
pbaspect([1 1 1]);
xlim(limlon);ylim(limlat);
whereXX, YY and ZZ are 401x401 double, prob is 1x 160801 double.
from all this graph I would need to extract only the values relative to the point of coordinates lonP_t and LatP_t (shown in the figure), in particular I need to know the value of the Z axis. This value I have to be able to extrapolate it to combine it with other data and then use it in another graph .
Can anyone help me?

回答 (1 件)

KSSV
KSSV 2022 年 3 月 24 日

0 投票

I don't think it is extrapolation, it is interpolation. Read about interp2.
iwant = interp2(XX,YY,ZZ,lonP_T,latP_t)

3 件のコメント

ELISABETTA BILLOTTA
ELISABETTA BILLOTTA 2022 年 3 月 24 日
no I don't have to interpolate the values ... I have to get the value of lonP_t and latP_t which is already inside the ZZ matrix and therefore also in prob. this value then I have to use it externally. from the graph in the figure you can see the value I need (0.022 ..), so I have to view it and then save it and use it in other matrices.
KSSV
KSSV 2022 年 3 月 24 日
Try the give function.
ELISABETTA BILLOTTA
ELISABETTA BILLOTTA 2022 年 3 月 24 日
the script is written in this question

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

カテゴリ

質問済み:

2022 年 3 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by