plotting a plane in three dimensions including data points
297 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
cgo
el 7 de Dic. de 2017
Respondida: cui,xingxing
el 25 de Ag. de 2022
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?
0 comentarios
Respuesta aceptada
Erivelton Gualter
el 22 de Oct. de 2018
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:
0 comentarios
Más respuestas (1)
Ver también
Categorías
Más información sobre Surface and Mesh Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!