MATLAB: Gaze Interest Heat Map

eye trackinggazeheat mapmeshgridplottingsurf

Hello! I am attempting to take x and y coordinates from an eye tracking study and translate them into "attention heat maps." My desired heat map should look similar to:
or:
I know the location of each gaze point, the frame rate, the time that the gaze point is created, however I cannot figure out how to turn this information into a usable format. This page is close to what I need:
except that I need to amend the code so that overlapping z values are added, instead of blended together. I.E. if z1=10 and z2=15, the resulting z value will be 25. Any help that can be given would be greatly appreciated.

Best Answer

It sounds like you are looking for a 2-dimensional histogram. There is none in default MATLAB, as far as I know. However, several users on the file exchange have made submissions to this point:
I believe the main idea for each is that you
  1. define x,y vectors that represent the grid of bins for the histogram
  2. then you count each entry of your data adding values to the bins,
  3. and finally you use pcolor or imagesc or something like that to make the plot.
Related Question