slice plot gives black surfaces

조회 수: 9 (최근 30일)
adi
adi 2019년 12월 16일
답변: adi 2019년 12월 16일
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
darova
darova 2019년 12월 16일
Can you attach the data?
adi
adi 2019년 12월 16일
hey,
attached here is the whole m. file
thanks

댓글을 달려면 로그인하십시오.

채택된 답변

darova
darova 2019년 12월 16일
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

추가 답변 (1개)

adi
adi 2019년 12월 16일
Thank you very much for your answer!!
it was really helpful!

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by