Hi @Korrawit
Since you have the "eyetrackRecord" data variable, you can ustilise the hist3 function to get the heatmap.
numBins = [100, 100];
% Sample data
numPoints = 5000; frameWidth = 1920; frameHeight = 1080;
x = frameWidth * rand(1, numPoints);
y = frameHeight * rand(1, numPoints);
% Create a 2D histogram of the gaze data
heatmapData = hist3([y', x'], 'Nbins', numBins);
% Normalize
heatmapData = heatmapData / max(heatmapData(:));
% Display the heatmap
figure;
imagesc(heatmapData);
colormap('jet'); % Use a colormap to represent the heat values
colorbar;
title('Gaze Heatmap'); xlabel('Horizontal Position'); ylabel('Vertical Position');
axis equal;
set(gca, 'YDir', 'normal'); % Flip the Y-axis to match the image coordinates
I hope this helps!