Weighted Counts of Vectors

4 ビュー (過去 30 日間)
SJ B
SJ B 2018 年 4 月 25 日
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 件)

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by