Help with drawing contour lines for a certain 3D surface

1 view (last 30 days)
Hello guys, I would appreciate if anyone can help me to draw contour lines for a certain function on a 3D drawing? My matlab code is:
load C1.txt % The Nodes coordinates Matrix load EC.txt % Element Connectivity Matrix load CC1.txt % Element stress colors
Nd=max(C1(:,1)); % No of Nodes Nodes=zeros(Nd,3); Nodes(C1(:,1),:)=C1(:,2:4); % Coordinates of the Nodes including the unintialized nodes NE=size(EC,1); % No of Elements
X=[Nodes(EC(:,1),1) Nodes(EC(:,5),1) Nodes(EC(:,2),1) Nodes(EC(:,8),1) Nodes(EC(:,3),1) Nodes(EC(:,11),1) ]; % X-Coordinate MAtrix NEx3 Y=[Nodes(EC(:,1),2) Nodes(EC(:,5),2) Nodes(EC(:,2),2) Nodes(EC(:,8),2) Nodes(EC(:,3),2) Nodes(EC(:,11),2) ]; % Y-Coordinate MAtrix NEx3 Z=[Nodes(EC(:,1),3) Nodes(EC(:,5),3) Nodes(EC(:,2),3) Nodes(EC(:,8),3) Nodes(EC(:,3),3) Nodes(EC(:,11),3) ]; % Z-Coordinate MAtrix NEx3 %c=ones(NE,1); Xm=-X;Ym=Y;Zm=Z; % Mirrored Cooridinate Matrices to print the other half hold on; % to plot the following on the same graph fill3(X',Z',Y',CC1'); % Plot the first half fill3(Xm',Zm',Ym',CC1'); % Plot the second half

Answers (0)

Categories

Find more on Contour Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!