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