Creating histograms of a matrix with weights in separate matrix
I have a matrix A with n values, and each value has a corresponding weight in matrix B. How do I create a weighted histogram in this case? I would like to not specify the number of bins, only the binwidth.
Thank you.
Note: There are no repeating values in A, and alos no repeating values in B.
A = randperm(100); % list of values I need a histogram of
B = randperm(100); % weights for every value in A
h = hist(A)
h.BinWidth = 10;I have a matrix A with n values, and each value has a corresponding weight in matrix B. How do I create a weighted histogram in this case? I would like to not specify the number of bins, only the binwidth.
Thank you.
Note: There are no repeating values in A, and alos no repeating values in B.
A = randperm(100); % list of values I need a histogram of
B = randperm(100); % weights for every value in A
h = hist(A)
h.BinWidth = 10; I have a matrix A with n values, and each value has a corresponding weight in matrix B. How do I create a weighted histogram in this case? I would like to not specify the number of bins, only the binwidth.
Thank you.
Note: There are no repeating values in A, and alos no repeating values in B.
A = randperm(100); % list of values I need a histogram of
B = randperm(100); % weights for every value in A
h = hist(A)
h.BinWidth = 10; histogram, weighted histogram MATLAB Answers — New Questions