Creating a matrix from a 3D surf plot
조회 수: 1 (최근 30일)
이전 댓글 표시
Is there a way to take 3 200x60 matrices that I plot as a surface and turn them into a single 3D matrix that I can then use slice on? I'm trying to take slices of a solid as it progress through space. I use surf on the three variables and it plots the first column of each variable then the second and so one resulting in a nice surface of the shape. Is there a way to then take that surface and turn it into a single matrix so I can then analyse interesting points? I read the help on 'slice', 'mesh' and and 'surf' and they imply I could do this.
Here is the code I'm using to plot the shape;
r = 1.0;
h = 2.0;
m = h/r;
[R,A] = meshgrid(linspace(0,r,60),linspace(0,2*pi,200));
X = R .* cos(A);
Y = R .* sin(A);
Z = m*R;
surf(X,Y,Z)
I thought I could create a volume matrix by doing this;
V=surf(X,Y,Z);
but then slice has issues as it doesn't create a m x n x p matrix but a single value.
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!