How we can make a HeatMap like this?

 Accepted Answer

Stijn Haenen
Stijn Haenen on 7 Nov 2019
Edited: Stijn Haenen on 7 Nov 2019
Hi,
Maybe not the best way but it works:
velocityrange=-80:5:80;
momentrange=-250:10:250;
for i=1:numel(momentrange)
for j=1:numel(velocityrange)
b=find(abs(moment-momentrange(i))<2.5);
c=find(abs(velocity-velocityrange(j))<5);
count=0;
for k=1:numel(b)
if find(b(k)==c)
count=count+1;
end
end
heatmap(i,j)=count;
end
end
imagesc(heatmap)

1 Comment

Thanks Stijn
But its not working on the data that i uploaded.

Sign in to comment.

More Answers (0)

Categories

Products

Tags

Asked:

on 7 Nov 2019

Commented:

on 7 Nov 2019

Community Treasure Hunt

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

Start Hunting!