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
2017년 11월 26일
편집: Walter Roberson
2017년 11월 26일
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
카테고리
도움말 센터 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!