MATLAB: How to bin the large 2D data to the same size as the smaller one and plot them by imagesc

.bin2d matrix

Hi there,
i got two 2D data, one has larger size, the other one has smaller size, how can i bin the larger one to the size size on the y axis and plot them together by imagesc?
Thanks for your help in advance.
Regards,
PJ

Best Answer

Try imresize() to make both matrices of equal length
dataAll_noHVbg_20200517 = imresize(dataAll_noHVbg_20200517, size(dataAll_noHVbg_20200516));
figure;
ax = axes();
hold(ax);
h1 = imagesc(dataAll_noHVbg_20200516, 'AlphaData', 0.5);
h2 = imagesc(dataAll_noHVbg_20200517, 'AlphaData', 0.5);
axis tight
This plot both matrices on the same axes using transparency.