MATLAB: How to plot three dimensional triangular based pyramid 3d pyramid3d shapes I want to plot a 3d triangular based pyramid in Matlab. In 2d it's basically an equilateral triangle. Shall I need to write an equation for each faces individually? How can I plot it? Thanks in advance. Best Answer Here is the way[x,y] = pol2cart(deg2rad(0:120:360),1);x1 = [x*0; x; x*0];y1 = [y*0; y; y*0];z1 = [x*0+1; x*0; x*0];surf(x1,y1,z1)axis vis3d Related SolutionsMATLAB: How to get different colours for different regions for this problem Hi pallav pal,one example patch as requested. All others can be drawn accordingly.x1=0:.00001:1;x2=0:.00001:.334;y1=x1.*x1;z1=sqrt(x1);y2=x1;y3=1-x1;y4=1-2*x2;plot(x1,y1,'r')hold onplot(x1,z1);plot(x1,y2,'g')plot(x1,y3,'k')plot(x2,y4,'r')axis([0 1 0 1])area1 = min(y1,y3);patch('XData',[x1,0],'YData',[area1,0],'FaceAlpha',0.7,'FaceColor','red')Kind regards,Robert MATLAB: Graphing a system of equations on the same set of axes in 3d? please [x, y] = meshgrid(linspace(-10, 10)); % Calculate the two surfaces z1 =(3*x+8*y)/2; z2=(6*x+2*y)/8; z3=9*x+4*y; % Visualize the two surfaces surface(x, y, z1, 'FaceColor', [0.5 1.0 0.5], 'EdgeColor', 'none'); surface(x, y, z2, 'FaceColor', [1.0 0.5 0.0], 'EdgeColor', 'none'); surface(x, y, z3, 'FaceColor', [0.5 0.5 0.5], 'EdgeColor', 'none'); view(3); camlight; axis vis3d Related QuestionWhich function to use for plotting a polygon with 4 coordinatesHow to use the streamline function for a circular area
Best Answer