Creating a 3D frequency (histogram/bar graph)

If I had 4 3x3 lower triangular matrices like:
A = [5 0 0
1 3 0
5 5 5]
B = [4 0 0
5 5 0
4 5 4]
C = [2 0 0
4 1 0
1 2 5]
D = [4 0 0
2 3 0
5 2 1]
I would like to keep track of the frequency of a number occurring in each spot of the matrix. In some sense, I would like to create a matrix whose values are actually vectors. For the example above, if I had a matrix, M, that counted the frequency, then:
M(1,1) = [0 0 1 0 2 1] % assuming I start the count 0 and only consider the lower triangle
M(2,1) = [0 1 1 0 1 1]
M(2,2) = [0 1 0 2 0 1]
... and so on.
After that, I would like to create a 3D plot with x-axis being the column position, y-axis being the count (from 0 to 5), and the z-axis keeps track of the frequencies.
Thanks!

Risposte (0)

Categorie

Scopri di più su 2-D and 3-D Plots in Centro assistenza e File Exchange

Richiesto:

il 20 Feb 2014

Community Treasure Hunt

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

Start Hunting!

Translated by