MATLAB: How to go about plotting an ellipse plotting So I have an ellipse (x^2/9)+(y^2/16)+(z^2/9)=1, how do I go about plotting the surface plot of this? Best Answer Another approach using https://www.mathworks.com/help/matlab/ref/isosurface.html*|isosurface|* (link):elpsfcn = @(x,y,z) (x.^2/9)+(y.^2/16)+(z.^2/9); %=1v = linspace(-5, 5, 150);[X,Y,Z] = meshgrid(v);elps = elpsfcn(X,Y,Z);figure(1)p = patch(isosurface(X,Y,Z,elps, 1), 'FaceColor','interp');vn = get(p, 'Vertices');cmv = colormap(jet(size(vn,1)));set(p, 'FaceColor','interp', 'EdgeColor','none', 'FaceVertexCData',cmv)grid onview(60, 25)axis equalxlabel('X')ylabel('Y')zlabel('Z') Related SolutionsMATLAB: How to use the Meshgrid and surf functions v = -7:0.1:7;[x, y] = meshgrid(v, v);z = cos(sqrt(x.^2 + y.^2));surf(x, y, z, 'edgecolor', 'none') MATLAB: How to plot ellipse x^2/4+y^2/9=1 and circle x^2+y^2=1 in a single figure window using ezplot and hold on commands ezplot('x^2/4+y^2/9=1'); axis equal; hold onezplot('x^2+y^2=1') Related QuestionPcolor-plot move along the z-axisAbout partial derivative using Matlab
Best Answer