function wireplot(v,e) % % DESCRIPTION: % Makes a wire plot of the polyhedron defined by vertices % in the rows of v and edges in the rows of e. % The plot is in the default 3-D view, % without axis labeling, tick marks and background. % % REQUIRED: % size(v,2) = 3, i.e.: v has three columns; % size(e,2) = 2, i.e.: e has two columns; and % all elements in e are in the range 1:size(v,1). % % EXAMPLE: % v = [0 0 0; 2 0 0; 1 2 0; 1 1 1]; % e = [1 2; 2 3; 3 1; 1 4; 2 4; 3 4]; % wireplot(v,e) % shows a tetrahedron % axis off hold on for i=1:size(e,1) x = [v(e(i,1),:); v(e(i,2),:)]; plot3(x(:,1),x(:,2),x(:,3)); end; view(3) hold off