MATLAB Answers

slice plot gives black surfaces

12 views (last 30 days)
adi
adi on 16 Dec 2019
Answered: adi on 16 Dec 2019
hey,
im having trouble with the slice plots.
i have a 3D matrix of electric field which i want to plot in the x-y plans along the z axis. (the third dimension of the matrix is the field in different Z axis values)
x,y,z are with dimensions of 1X201, Eg are with dimensions of 201X201X201
This is my code:
figure
xslice = [];
yslice = [];
zslice = [z(1),z(50),z(70),z(201)];
slice(z,y,x,abs(Eg(:,:,:)),zslice,yslice,xslice)
colorbar
the result i get is black surfaces, (i need to see the field distribution in x-y plane in each surface).
what can be the problem? how can i fix this?
This is the result:
Capture.PNG
thanks

  2 Comments

darova
darova on 16 Dec 2019
Can you attach the data?
adi
adi on 16 Dec 2019
hey,
attached here is the whole m. file
thanks

Sign in to comment.

Accepted Answer

darova
darova on 16 Dec 2019
Planes are not black. THe mesh is just too fine
Add to your code
h = slice(z,y,x,abs(Eg(:,:,:)),zslice,yslice,xslice);
set(h,'EdgeColor','none');
img1.png

  0 Comments

Sign in to comment.

More Answers (1)

adi
adi on 16 Dec 2019
Thank you very much for your answer!!
it was really helpful!

  0 Comments

Sign in to comment.

Sign in to answer this question.


Translated by