Calculate median values of slices of array associated with histogram bins
이전 댓글 표시
I have an array (array1) which I want to put into histogram bins. I have a second array (array2) which is the same length.
I can sum the values of array2 in each bin with this:
[count, edges, idx] = histcounts(array1,edges);
binsums = accumarray(idx,array2);
But how can I calculate the median values of array2 in each bin?
채택된 답변
추가 답변 (1개)
Steven Lord
2023년 11월 15일
0 개 추천
If all you want is the bin numbers, you could also use the discretize function instead of histcounts.
카테고리
도움말 센터 및 File Exchange에서 Histograms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!