How to get a tilted slice in 3-D data?
15 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Yinchao Chen
il 3 Mar 2017
Commentato: Yinchao Chen
il 3 Mar 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?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/161281/image.png)
0 Commenti
Risposta accettata
Aniruddha Katre
il 3 Mar 2017
Modificato: Star Strider
il 3 Mar 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
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Surface and Mesh Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!