Weighted Counts of Vectors
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi, I have a vector of x,y coordinates each with weights. I want to bin the (x,y) coordinates per some general xedges and yedges but also include the weights for each of these coordinates. Here's a simple example with an attempt- I'm not sure how to incorporate the weights:
matrix=[randi(11,1,5); randi(11,1,5).*0.75; [0.5 1 1 2 0.5]];
xedge=0:5:round(max(init)/5)*5;
yedge=xedge;
counts=histcounts2(matrix(1,:),matrix(2,:),xedge,yedge);
This is able to bin and weight each coordinate equally instead of with 0.5 for the first coordinate, 1 for the second coordinate, etc. I was wondering how I could do the bin and weighting efficiently with large matrices with three rows (x,y coordinates and weights).
Thanks!
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Histograms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!