how to plot the 3D graph

조회 수: 2 (최근 30일)
Jiali
Jiali 2019년 9월 30일
답변: darova 2019년 9월 30일
I build the 3D grid and form a function based on the grid. I would like to know how to display the data shown in the below figure. Could you please give me some suggestions? Thank you very much!
[X1,Y1,Z1]=ndgrid(x_1grid,y_1grid,z_1grid);
% sphere
UX= (X1.^2 + Y1.^2+Z1.^2) - (diam/2.0)^2 <= 0;
Data=4*(UX==1)+1*(UX==0);
sphere.png

채택된 답변

darova
darova 2019년 9월 30일
There is no built-in function for cube displaying
I took your code and piece of code HERE
Modificated code produces this:
img1.png img2.png

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by