How do I the minimum points on a 3D surface diagram (x,y,z) as a function of the x and y variables?
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Alex Bregazzi
le 14 Déc 2019
Commenté : Alex Bregazzi
le 15 Déc 2019
Here I have plotted an energy surface diagram:
clc, clear;
%x=phi, y=theta, z=h
K=1;
hval = 2*pi;
y=pi/3;
[ x, z] = meshgrid(0:0.1:hval, -2:0.1:2);
E= (K*sin(x-y).^2)-K*z.*cos(x);
figure
surf(x, z, E)
xlabel('phi')
ylabel('h')
zlabel('E')
rotate3d on
cos(0)
sin(-y)
F= (K*sin(0-y).^2)-K*z.*cos(0);
I need to obtain the minimum energy points on this diagram as a function of phi and h to plot another graph. My thought was to create for loops which go through each value of phi to find the minimum energy and return the value of h, but I haven't been able to do this.
0 commentaires
Réponse acceptée
Ridwan Alam
le 14 Déc 2019
Modifié(e) : Ridwan Alam
le 14 Déc 2019
I am assuming your x-axis is phi and y-axis is h:
min_phi = min(E,[],1);
min_h = min(E,[],2);
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots 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!