Making a 3D Density plot given Density at each point (X,Y,Z)

48 views (last 30 days)
I have a 3D matrix where each element corresponds to the density at point (X,Y,Z), see attached. The coordinates and data are loaded by the below code. The first two axis of xyPhi correspond to xh and yh, and the third axis corresponds to z. I would like to do a 3D density plot using this data, it should look something like a puck. I essentially want the equivalent of ListDensityPlot3D in Mathematica. Here is what the plot looks like in mathematica
M=60;%number of radial spatial lattice points
N = 60; %number of z-axis lattice points
R = 15;
Z = 14;
dr=double(2*R/(2*M+1));
dz = 2*Z/N;
xh = dr*(-M:1:M);
yh = dr*(-M:1:M);
z = -Z*ones(N+1,1) + dz*(0:1:N).';
load('phi_cylind_film_xy','xyPhi')

Answers (1)

Vinayak
Vinayak on 20 Oct 2022
MATLAB provides a variety of plots for visualization such as line plots, scatter charts, animated plots etc.
More on the different types of plots provided can be found here
To plot data with density, you can have your data converted to matrices and use the mesh and surface plots.
More on this can be found here, https://www.mathworks.com/help/matlab/surface-and-mesh-plots-1.html

Community Treasure Hunt

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

Start Hunting!