Surface plot for Gibbs free energy
Show older comments
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
Answers (1)
Walter Roberson
on 26 Nov 2017
Edited: Walter Roberson
on 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
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!