MATLAB: Plotting a plane in three dimensions including data points 3 dimensionsplaneplotplot3 Hi, I have a plane obtained via regression. Let's say this is z = 2x + 3y + 4. I want to plot this plane AND the data points. How do I do this? Best Answer Run the following code:[x y] = meshgrid(-10:1:10);z = 2.*x + 3.*y + 4;surf(x,y,z);To add the data you can add the following lines:hold on;plot3(DataX, DataY, DataZ);You can check the meshgrid and surf function in the following links:<http://www.mathworks.com/access/helpdesk/help/techdoc/ref/meshgrid.shtml>http://www.mathworks.com/access/helpdesk/help/techdoc/ref/meshgrid.shtml Related SolutionsMATLAB: How to plot x^2+z^2=9 above the xy plane and between y=-1 and y=2 How about:syms x y z;[x,y]=meshgrid(-10:1:10);z = abs(sqrt(9-x.^2));surf(x,y,z);ylim([-1 2]) MATLAB: How to plot it https://in.mathworks.com/matlabcentral/answers/93623-how-do-i-plot-the-line-of-intersection-between-two-surfaces Related QuestionPlot equation of planePlane y=xHow to plot given plane in matlab (It will be 3d)How to add 3D points to a surfc surface plot3D plane in MATLAB
Best Answer