3D grid from a large 3D matrix

I have a 3D matrix, .mat file attached in this thread, which has a 200x200x600 matrix has 5021 non-zero values and 23.9 million zero values.
It is a cuboid grid (x and y = -200:200 and z = -600 to 600) that contains charge data.I used the vol3d v2 function to visualize the 3D cuboid grid that I have, however the number of zero values dilute the non-zero values making it unable to observe the grid properly.
I believe obtaining a slice of the grid at x=y=0 would provide some insights as how the charge is distributed (this is a charge grid), however I am unable to create a meshgrid for the co-ordinate axes where x=y=-200:200 and z=-600:600
The in-built MATLAB app - volumeViewer yeilds a similar result. Hope you could provide some direction, I have attached the .mat file containing the 200x200x600 matrix if it is any help.

 Respuesta aceptada

KSSV
KSSV el 23 de Jun. de 2020
Editada: KSSV el 23 de Jun. de 2020
load Q3D.mat ;
x = linspace(-200,+200,200) ;
y = linspace(-200,+200,200) ;
z = linspace(-600,+600,600) ;
[X,Y,Z] = meshgrid(x,y,z) ;
% give your range
xslice = [50:100] ;
yslice = [] ;
zslice = 0 ;
slice(X,Y,Z,Q3D,xslice,yslice,zslice)

5 comentarios

Hans123
Hans123 el 23 de Jun. de 2020
Thanks KSSV this works as I want it to, however I am using the vol3 v2 function
and I want to slice that grid in half. This slice function basically creates a plane in the middle of the grid
H = vol3d('cdata',Q3D,'texture','3D')
KSSV
KSSV el 23 de Jun. de 2020
You can give your required coordinates in xslice, yslice and zslice.
Hans123
Hans123 el 23 de Jun. de 2020
The slice shows a complete black plane - where there should be non-zero data and majority zero data. Could you help point out the reason for this
Hans123
Hans123 el 23 de Jun. de 2020
^I managed to fix that issue, my mesh is too fine. I set my edgecolor to non. Thanks KSSV
KSSV
KSSV el 23 de Jun. de 2020
Hey perfect.....yes edgecolor is an option...also try shading interp after plot.

Iniciar sesión para comentar.

Más respuestas (0)

Preguntada:

el 23 de Jun. de 2020

Comentada:

el 23 de Jun. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by