Plot a 3D map surface with xyzz, where I want one of the z-axis to be the color bar and the other 3 variables to be the axis

2 次查看(过去 30 天)
I have the values, where first column is time, 2nd is temperature, 3rd is particle size, then the yield. I want the yield to be the color bar and the first 3 column to be the axis xyz
0.1846, 400, 0.42, 12
0.1846, 500, 0.42, 13.9
0.1846, 600 , 0.42 , 15.7
0.4 , 500, 1.5, 2.77
4.4, 550, 0.55, 16.43
37.11, 450, 0.55 , 28.04
37.11, 550, 0.55 , 24.47

采纳的回答

DGM
DGM 2022-1-28
If I'm understanding this correctly:
A = [0.1846 400 0.42 12;
0.1846 500 0.42 13.9;
0.1846 600 0.42 15.7;
0.4 500 1.5 2.77;
4.4 550 0.55 16.43;
37.11 450 0.55 28.04;
37.11 550 0.55 24.47];
xf = linspace(min(A(:,1)),max(A(:,1)),100);
yf = linspace(min(A(:,2)),max(A(:,2)),100).';
z = griddata(A(:,1),A(:,2),A(:,3),xf,yf,'linear');
c = griddata(A(:,1),A(:,2),A(:,4),xf,yf,'natural');
surf(xf,yf,z,c); hold on
scatter3(A(:,1),A(:,2),A(:,3),50,'k')
colorbar
colormap(parula)
shading flat

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by