필터 지우기
필터 지우기

how can i have plot3 from different matrix

조회 수: 1 (최근 30일)
sahar kheibarihafshejani
sahar kheibarihafshejani 2020년 8월 13일
편집: Ayush Gupta 2020년 9월 1일
Hello, i have have meshgrid matrix of x , y, z position of 3 different layers(9 different matrix) and now want to have a 3D plot which connect the first x,y,z, position of the first layer to the x,y,z position to te second the then third one. with find function i could find the row and culomn of desire positions now how can i define it for plot3 function?
[row col] = find(mod(nr_up,2)==1 & mod(nr_up,2)==1);
for ii = 1:length(row)
i=row(ii);
for jj=1:length(col)
j=col(jj);
xBottom=xBottomMat(i,j);
yBottom=yBottomMat(i,j);
zBottom=zBottomMat(i,j);
x_low=xl_low(i,j);
y_low=yl_low(i,j);
zLow=zLowMat(i,j);
x_up=xl_up(i,j);
y_up=yl_up(i,j);
zUp=zUpMat(i,j);
x_last=xl_last(i,j);
y_last=yl_last(i,j);
zLast=zLastMat(i,j);
x= [posSource(1),xBottom,x_low,x_up,x_last];
y=[posSource(2),yBottom,y_low,y_up,y_last];
z=[posSource(3),zBottom,zLow,zUp,zLast];
plot3(x,y,z);axis equal; hold on ;grid on;

답변 (1개)

Ayush Gupta
Ayush Gupta 2020년 9월 1일
편집: Ayush Gupta 2020년 9월 1일
To make a 3D mesh from a set of points, the generateMesh function in MATLAB can be used. To include 3-D geometry in it we can use importGeometry or geometryFromFresh. The documentation for generateMesh can be accessed from here along with a few examples on how to use it.

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by