Surface plot for Gibbs free energy

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

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 11 月 26 日
編集済み: Walter Roberson 2017 年 11 月 26 日

0 投票

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

カテゴリ

タグ

質問済み:

2017 年 11 月 26 日

編集済み:

2017 年 11 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by