surfCustom

PURPOSE ^

% custom surface plot

SYNOPSIS ^

function surfCustom(XX,YY,ZZ)

DESCRIPTION ^

% custom surface plot

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% custom surface plot
0002 function surfCustom(XX,YY,ZZ)
0003 %
0004 hh=surf(XX,YY,ZZ);
0005 %
0006 shading interp
0007 light
0008 lighting phong
0009 %
0010 axis('tight','square')
0011 xlabel('$x$','Interpreter','latex')
0012 ylabel('$y$','Interpreter','latex')
0013 zlabel('$f$','Interpreter','latex')
0014 %title(obj.funName)
0015 %
0016 %% Extract X,Y and Z data from surface plot
0017 X=hh.XData;
0018 Y=hh.YData;
0019 Z=hh.ZData;
0020 %% Divide the lengths by the number of lines needed
0021 xlength = size(ZZ,2);
0022 ylength = size(ZZ,1);
0023 xnumlines = 10; % 10 lines
0024 ynumlines = 10; % 10 partitions
0025 xspacing = round(xlength/xnumlines);
0026 yspacing = round(ylength/ynumlines);
0027 %% Plot the mesh lines
0028 % Plotting lines in the X-Z plane
0029 hold on
0030 for i = 1:yspacing:ylength
0031     mesh([X(i,:);X(i,:)], [Y(i,:);Y(i,:)], [Z(i,:);Z(i,:)],'EdgeColor',0.7.*[1,1,1]);
0032 end
0033 % Plotting lines in the Y-Z plane
0034 for i = 1:xspacing:xlength
0035     mesh([X(:,i),X(:,i)], [Y(:,i),Y(:,i)], [Z(:,i),Z(:,i)],'EdgeColor',0.7.*[1,1,1]);
0036 end
0037 hold off
0038 end

Generated on Tue 28-May-2019 16:00:34 by m2html © 2005