How to get a tilted slice in 3-D data?

조회 수: 7 (최근 30일)
Yinchao Chen
Yinchao Chen 2017년 3월 3일
댓글: Yinchao Chen 2017년 3월 3일
By using slice in MATLAB, I can get a slice plot which is perpendicular to the axes. But I was wondering how to get a tilted slice (not perpendicular to the axes), like the picuture shown?

채택된 답변

Aniruddha Katre
Aniruddha Katre 2017년 3월 3일
편집: Star Strider 2017년 3월 3일
See the section about slicing at arbitrary angles of the documentation page for the slice function.
Here's a quick example:
% Data
[x, y, z] = meshgrid(-3:1:3);
v = x.^2 + y.^2 + z.^2;
% Data defining a surface
[xs, ys] = meshgrid(-3:1:3);
zs = -xs + ys;
% Slice along it
slice(x, y, z, v, xs, ys, zs)
colorbar
  댓글 수: 1
Yinchao Chen
Yinchao Chen 2017년 3월 3일
Much appreciated. I've got the answer on: http://cn.mathworks.com/help/matlab/ref/rotate.html for a more specifically solution. By defining the direction, I can thus calculate the alpha i need.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by