필터 지우기
필터 지우기

Creating a contour plot of magnitude in 3D

조회 수: 5 (최근 30일)
Michael King
Michael King 2019년 7월 9일
편집: G A 2019년 7월 9일
I want to create a 3D contour plot from a matrix which has 4 columns like this example below (example is simplified version of my data)
X Y Z Mag
0 0 0 15
1 0 0.5 4
0 1 0.5 13
1 1 1 20
I want to plot this in as a surface in a 3D (x,y,z) plane with a contour over the surface defined by the magnitude. How would I go about this?

답변 (1개)

G A
G A 2019년 7월 9일
편집: G A 2019년 7월 9일
Something like this?
a=-1:0.1:1;
b=-1:0.1:1;
[X,Y]=meshgrid(a,b);
Z=X.^2+Y.^2;
M=[0.5 1];
hold on
grid on
surf(X,Y,Z),
shading interp,
view(3),
[~,c]=contour3(X,Y,Z,M);
c.LineWidth=5;
c.LineColor='g';

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by