A matrix visualization 3d-histogram
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a (1372x3) matrix consisting 3 vectors r(1372x1),m(1372x1) and n(1372x1).
these vectors must be arranged in 3D histogram, where a sum of "n" controls the height. Vector n consists entirely of 1 and 0.5
also to be understood as "r" is the x-axis and "m" is the y-axis and "n" is the z-axis.
it would be really cool if i could control the division of r and m with a input of 'k'.
thanks!!!!
댓글 수: 1
Sean de Wolski
2013년 5월 14일
A small example of inputs/operations/expected outputs would go a long way if Stephan's answer doesn't resolve this.
답변 (1개)
Stephan M. H.
2013년 5월 14일
편집: Stephan M. H.
2013년 5월 14일
Hi Frederik,
from your explanation r(i) and m(i) correspond to and x-y position where n(i) is the z value at this point. If so, than you should have information of where your x-grid points and y-grid points are and therefore the dimension of your z-matrix.
A straight forward way of realizing a 3D histogram in your case would then make use of meshgrid and hist3 .
The steps you need to do is create monotonic vectors x and y containing your grid points in both dimension. Then obtain the mesh data
[X,Y]= meshgrid(x,y)
Reshape your n-vector using
Z = reshape(n,a,b)
where a and b are the dimensions of your x and y grid vectors.
This should work, although your explanation with x,y,z doesn't correspond to "control with sum of n", which you stated before and I don't quite get. Same goes for the control input k, which didn't explain enough.
best, Stephan
댓글 수: 1
Daniel Bridges
2016년 4월 2일
Is Stephan basically creating an x-y bar graph? I don't see that this answer addresses the case where you have a random set of (x,y,z) points, i.e. z not referring to a location's height; where z is not a one-to-one function of x and y. (For example, having both points (1,1,3) and (1,1,-2) in the set, and really wanting to count how many times each ordered pair appears.)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Distribution Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!