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

7 visualizaciones (últimos 30 días)
Yinchao Chen
Yinchao Chen el 3 de Mzo. de 2017
Comentada: Yinchao Chen el 3 de Mzo. de 2017
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?

Respuesta aceptada

Aniruddha Katre
Aniruddha Katre el 3 de Mzo. de 2017
Editada: Star Strider el 3 de Mzo. de 2017
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 comentario
Yinchao Chen
Yinchao Chen el 3 de Mzo. de 2017
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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by