2016-10-16 56 views
-1

我已經嘗試過使用terndemo,但是我無法獲得像您這樣的圖形數據。我的目的是提出如何,每個公式在3D三元情節中負責不同的zetasize。我試圖編輯你的文件,但結果是不同的。如何繪製三種混合物的三元三元圖

%% Three D plot for ZetaSize of oil, surfactant and cosurfactant isotropic mixture blends 
experimental = [... 
    20 60 20 
    20 50 30 
    20 40 40 
    20 30 50 
    20 20 60 
    25 60 15 
    25 50 25 
    25 40 35 
    25 30 45 
    25 20 55 
    30 60 10 
    30 50 20 
    30 40 30 
    30 30 40 
    30 20 50 
    35 55 10 
    35 45 20 
    35 35 30 
    35 25 40]; 
data = [... 
    252.2 
    120.4 
    165.7 
    178.3 
    158.9 
    322 
    294.8 
    265.5 
    160.7 
    431.9 
    225.2 
    416.3 
    484.9 
    458.2 
    765 
    362.2 
    526 
    331 
    743.7]; 

A = experimental(:, 1)'; 
B = experimental(:, 2)'; 
C = 1 - (A + B); 

ternsurf(A, B, data); 
ternlabel('oil', 'surf', 'cosurf***strong text***'); 
+0

請你解釋一下,究竟是你想這樣做,並顯示到目前爲止什麼都做?因爲它真的不清楚。 – Kamiccolo

+0

其實我需要繪製乳狀液的三元相圖,它由三個階段組成,以不同的比例配製給出不同的zetasizes。我的情節應該代表三種混合物對三維zetasize方差的影響。我真的想要一個像這個鏈接提供給我的情節https://www.mathworks.com/matlabcentral/fileexchange/2299-alchemyst-ternplot –

+0

你需要更清楚你有什麼數據和你到目前爲止嘗試過。你鏈接到的軟件包有一個'ternsurf'命令,它可以處理你似乎在尋找的那種情節。看一看在包描述中產生輸出的'terndemo'文件。更新您的問題以表明您嘗試了什麼以及出了什麼問題,然後我們可以幫助您。 – chthonicdaemon

回答

0

我已更新此項以符合您的資料。請注意,座標的最後一行不會加上100.我已經將它除以100,並繪製出pcolor圖而不是3D表面,因爲我認爲它對數據更清晰。如果你想要一個3D表面,你只需要將數據列除以1000左右即可得到正確的刻度並使用ternsurf

%% Three D plot for ZetaSize of oil, surfactant and cosurfactant isotropic mixture blends 
experimental = [... 
    20 60 20 
    20 50 30 
    20 40 40 
    20 30 50 
    20 20 60 
    25 60 15 
    25 50 25 
    25 40 35 
    25 30 45 
    25 20 55 
    30 60 10 
    30 50 20 
    30 40 30 
    30 30 40 
    30 20 50 
    35 55 10 
    35 45 20 
    35 35 30 
    35 45 40 % this row doesn't add to 100 
]/100; 
data = [... 
    252.2 
    120.4 
    165.7 
    178.3 
    158.9 
    322 
    294.8 
    265.5 
    160.7 
    431.9 
    225.2 
    416.3 
    484.9 
    458.2 
    765 
    362.2 
    526 
    331 
    743.7]; 

A = experimental(:, 1)'; 
B = experimental(:, 2)'; 
C = 1 - (A + B); 

ternpcolor(A, B, data); 
shading interp 
ternlabel('oil', 'surf', 'cosurf'); 
colorbar 

這將導致以下情節:

Program output