% filename: plane_plot.m % version: 7.6.0.324 (R2008a) plane_plot([1 2 4],[3 3 1]); function plane_plot(n1,n2,n) if nargin<3 n=10; end s=bsxfun(@times,[n1,n2],((0:n-1)/(n-1))'); x=bsxfun(@plus,s(:,1),s(:,4)'); y=bsxfun(@plus,s(:,2),s(:,5)'); z=bsxfun(@plus,s(:,3),s(:,6)'); mesh(x,y,z); line('xdata',[0,n1(1)],'ydata',[0,n1(2)],'zdata',[0,n1(3)],'color','r','linewidth',1); line('xdata',[0,n2(1)],'ydata',[0,n2(2)],'zdata',[0,n2(3)],'color','r','linewidth',1); end