Plot 3D Graph and make level curves
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Bryan Ambrósio
le 22 Avr 2021
Commenté : Star Strider
le 1 Mai 2021
Hi
I have 3 vectors, where:
X is a vector of numbers;
Y is a vector of numbers;
Z is a function that depends on X and Y (i.e)
Z = 4.6597*x.^2 + 2.6897*x.*y - 0.023578*x + 8.1189*y.^2 - 1.9553*y - 1.2304;
I want to plot a 3D curve and I am not succeding. Can someone help me please? Thanks
0 commentaires
Réponse acceptée
Star Strider
le 23 Avr 2021
Modifié(e) : Star Strider
le 23 Avr 2021
EDIT — (23 Apr 2021 at 03:17)
I was intending that to use any of the q3D plotting functions, the vectors need to be transformed into matrices first, and then transformed back into vector to use plot3:
X = ...;
Y = ...;
[Xm,Ym] = ndgrid(X,Y);
Zfcn = @(x,y) 4.6597*x.^2 + 2.6897*x.*y - 0.023578*x + 8.1189*y.^2 - 1.9553*y - 1.2304;
Zm = Zfcn(Xm,Ym);
figure
plot3(Xm(:), Ym(:), Zm(:))
grid on
.
8 commentaires
Plus de réponses (2)
Voir également
Catégories
En savoir plus sur Get Started with Curve Fitting Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!