How can I extract data from a heat map using separate point coordinates?

조회 수: 2 (최근 30일)
I'm using the following code to plot a heat map with separate X,Y coordinates overlaid. The heat map is of flow conditions (time-averaged turbulent kinetic energy, TKE) in a flume, while my overlaid points are fish locations throughout an experiment.
% plot TKE
sa=f19p2hpvcd3;
imagesc((sa.x-0.15),sa.z,fliplr(flipud(sa.meank)),[minval maxval])
set(gca,'YDir','normal')% colormap jet
% colorbar
% xlabel('x ( m )')
axis([xlow xhigh ylow yhigh])
hold on
% plots the scatter points
scatter(a1(:,1),a1(:,2), 'red', 'x')
This creates this:
What I want to do is to use the scatter points that I've overlaid to extract the underlying value on the heat map, and then insert the value into my pre-existing double as a new column, so that each X,Y coordinate is associated with a different TKE value.
Is there a simple way to do this that I'm missing? Thanks in advance.

채택된 답변

KSSV
KSSV 2021년 8월 3일
Read about interp2.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Geographic Plots에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by