3D histogram plot for a tensor data

6 visualizaciones (últimos 30 días)
SARATH CHANDRA REDDY NALLALA
SARATH CHANDRA REDDY NALLALA el 13 de Mzo. de 2021
Editada: SARATH CHANDRA REDDY NALLALA el 27 de Mzo. de 2021
Hey everyone,
I am begineer in matlab with limited experience in programming. I have a tensor data (x,y,z values) of contact orientation (about 10000 data values). I want to plot these orientation data using a sphere or icosphere such that length of bins represent the number of points oriented in that particular direction. Can anyone please provide some reference code to solve this problem.
I am also adding the data for your reference.
Thanking you in advance,
Sarath

Respuestas (1)

Rishik Ramena
Rishik Ramena el 18 de Mzo. de 2021
Have a look at the solution posted here. You can use cart2sph to convert your cartesian coordinates to spherical coordinates. Or you can modify the code to work with your cartesian tensor data.
  3 comentarios
Rishik Ramena
Rishik Ramena el 18 de Mzo. de 2021
The 'theta', 'phi' and 'H' correspond to the azimuth,elevation and r respectively.
SARATH CHANDRA REDDY NALLALA
SARATH CHANDRA REDDY NALLALA el 20 de Mzo. de 2021
@Rishik: I guess H should be a vector with size which is a combination of size of theta and phi, therefore H can't be r as 'r' is a column vector. What I did was I have defined theta_vec and phi_vec as
For 50 data points
theta_vec = linspace(0,2*pi,50);
phi_vec = linspace(0,2*pi,50);
[az,el,r] = cart2sph(x(1:50),y(1:50),z(1:50)) % x,y,z are contact orientations % r is coming as 1 for all the 50 points
H = 100*meshgrid(az,el); % If use r here as you suggested it is showing error as it is not equivalent to the theta x phi size
Though the code is running, It is not correctly representing the required orientation may be I done some thing wrong with the 'H'.
Can pls let me know where I am going wrong.
Thanking you in advance,
best wishes
Sarath

Iniciar sesión para comentar.

Categorías

Más información sobre Histograms en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by