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

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.

 Réponse acceptée

Plus de réponses (0)

Produits

Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by