Surface plot for Gibbs free energy
Afficher commentaires plus anciens
Hi all, I have x1 and x2 as 50*1 vector and G as 50*2 matrix. I want a surface plot for this. How do i do this? Thank you
Réponses (1)
Walter Roberson
le 26 Nov 2017
Modifié(e) : Walter Roberson
le 26 Nov 2017
Guessing that you are asking to plot two different surfaces with scattered coordinates identified by x1 and x2, then:
probex1 = linspace(min(x1), max(x1));
probex2 = linspace(min(x2), max(x2));
[X1, X2] = ndgrid(probex1, probex2);
G1 = griddata(x1, x2, G(:,1), X1, X2);
G2 = griddata(x1, x2, G(:,2), X1, X2);
surf1 = surf(X1, X2, G1, 'edgecolor', none');
hold on
surf2 = surf(X1, X2, G2, 'edgecolor', none');
xtitle('x1');
ytitle('x2');
ztitle('Gibbs Energy');
legend([surf1, surf2], {'G(:,1)', 'G(:,2)'});
hold off
Catégories
En savoir plus sur Surface and Mesh Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!