hi i need to do heatmap and have some problem with histcounts functions and the map

1 vue (au cours des 30 derniers jours)
ok
so thats the problem -
i have vector d (size 5,000)
and i have matrix mat_X which show positions - every column show x positions over time for corresponding d in the vector (my original mat_X is 5000*5000 matrix)
so i want to built accumulated heat map of position along x (col from mat_X) for different d value (1position from the vector for the first col, 2 for 2nd and so on)
so for doing so, i need first to use histcounts for every col (since my data is not so small )
so i did this loop
bins=50;
Accumulated_Prob=zeros(bins,length(d));
for i=1:length(d)
[P,cc] = histcounts(mat_X(:,i),bins,'normalization','probability');
Accumulated_Prob=Accumulated_Prob+P';
end
heatmap(Accumulated_Prob)
title('Accumulated Heat Map of RF x position, Vf at x=-1')
xlabel('d')
ylabel('x')
but... i get only black graph...
i would appreciate help !

Réponse acceptée

KSSV
KSSV le 8 Sep 2020
Modifié(e) : KSSV le 8 Sep 2020
You have to save the values into a matrix in loop, which you are not doing.
bins=50;
Accumulated_Prob=zeros(bins,length(d));
for i=1:length(d)
[P,cc] = histcounts(mat_X(:,i),bins,'normalization','probability');
Accumulated_Prob(:,i) = P';
end
heatmap(Accumulated_Prob)
title('Accumulated Heat Map of RF x position, Vf at x=-1')
xlabel('d')
ylabel('x')
  4 commentaires
KSSV
KSSV le 8 Sep 2020
Thanks is accepting/ voting the answer. :)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Distribution Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by