It is easy to plot slices along a straight line plane (e.g. x=-50, and y=40 in the first figure) using the slice function.
[x,y,z]=meshgrid(-55:0.1:-25,30:0.1:60,1:1:150); slice(x,y,z,c,-50,40,[]); shading flat;
However, how can I get a slice along a curved plane (like the second figure)?

 채택된 답변

uxsmfu
uxsmfu 2018년 11월 8일

1 개 추천

After some digging, problem solved. I figured I should share the solution here.
The index terms (xd,yd,zd) need to be 2-D.
[yd,zd]=meshgrid(lat,depth);
[xd,zd]=meshgrid(lon,depth);
slice(x,y,z,c,xd,yd,zd);

댓글 수: 1

Guillaume
Guillaume 2018년 11월 8일
"After some digging, problem solved. I figured I should share the solution here. The index terms (xd,yd,zd) need to be 2-D."
Basically, what I already said a day earlier in my answer: "Just pass a matrix of location for your x and y slice location"
Sometimes, you wonder why bother answering questions...

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

추가 답변 (1개)

Guillaume
Guillaume 2018년 11월 7일

0 개 추천

how can I get a slice along a curved plane
Just pass a matrix of location for your x and y slice location instead of fixed -50, 40. There's even an example in the documentation of slice

카테고리

도움말 센터File Exchange에서 Graphics Performance에 대해 자세히 알아보기

태그

질문:

2018년 11월 7일

댓글:

2018년 11월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by