Effacer les filtres
Effacer les filtres

plotting a plane in three dimensions including data points

195 vues (au cours des 30 derniers jours)
cgo
cgo le 7 Déc 2017
Modifié(e) : cui,xingxing le 27 Avr 2024
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?

Réponse acceptée

Erivelton Gualter
Erivelton Gualter le 22 Oct 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:

Plus de réponses (1)

cui,xingxing
cui,xingxing le 25 Août 2022
Modifié(e) : cui,xingxing le 27 Avr 2024
repeated question.
-------------------------Off-topic interlude, 2024-------------------------------
I am currently looking for a job in the field of CV algorithm development, based in Shenzhen, Guangdong, China,or a remote support position. I would be very grateful if anyone is willing to offer me a job or make a recommendation. My preliminary resume can be found at: https://cuixing158.github.io/about/ . Thank you!
Email: cuixingxing150@gmail.com

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by