% illustration of the command patch figure x1 = [0 1 1]; y1 = [0 0 1]; z1 = [0 0 0]; % x1, y1, and z1 are the corners of a triangle patch(x1,y1,z1,'r'); hold on x2 = [0 1 0]; y2 = [0 1 1]; z2 = [0 0 1]; % x2, y2, z2 defines another patch patch(x2,y2,z2,'g'); view(3) % to show in 3d grid on