Weighted Counts of Vectors
조회 수: 2 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Histograms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!