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
0 个评论
采纳的回答
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 Center 和 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!
