颜值超高的4D平面图/matlab

clear, clc, close all
x=[7.5    7.5    7.5    7.5    10    10    10    10    10    10    10    10    10    12.5    12.5    12.5    12.5];
y=[50    40    60    50    50    50    50    50    40    40    60    60    50    50    40    60    50];
z=[34    36    36    38    36    36    36    36    38    34    36    34    36    34    36    36    38];
D=[23.237    23.856    24.998    28.923    27.897    26.346    26.146    26.236    26.470    19.581    24.645    20.186    26.256    21.496    20.444    24.516    23.350];

over the range 7.5≤ x ≤ 12.5, 40 ≤y ≤50, 34 ≤ z ≤38:
D=(-1482.66715-1.16168.*x+4.72252.*y+76.9875.*z+0.0293.*x.*y+0.0068.*x.*z-0.06075.*y.*z-0.045336.*x.^2-0.028393.*y.^2-1.01635.*z.^2);
[x,y,z] = meshgrid(7:.2:13,35:.2:65,32:.2:40);
v = x.*exp(-x.^2-y.^2-z.^2);
xslice = [8,10,12]; 
yslice = [40,50,60]; 
zslice = [34,36,38];
slice(x,y,z,D,xslice,yslice,zslice)
colormap hsvfigure(1)
scatter3(x(:), y(:), z(:), 2, D(:), 'filled')
set(gca, 'FontName', 'Times New Roman', 'FontSize', 14)
xlabel('X')
ylabel('Y')
zlabel('Z')
colorbar

[x,y,z] = meshgrid(x,y,z);
v = x.*exp(-x.^2-y.^2-z.^2);
xslice = [9,11]; 
yslice = [40,60];
zslice = [34,38];
slice(x,y,z,D,xslice,yslice,zslice)
set(gca, 'FontName', 'Times New Roman', 'FontSize', 14)
xlabel('X')
ylabel('Y')
zlabel('Z')
colormap hsv
colorbar


% form the axes
x = 0:0.5:10;                   % first dimension independent variable
y = 0:0.5:10;                   % second dimension independent variable
z = 0:0.5:10;                   % third dimension independent variable
[X, Y, Z] = meshgrid(x, y, z); 
data=% form the 3D data grid

% form the data matrix - it is the fourth dimension
% the data could be imported from a file or could be generated via equation 
data = abs(cos(X) + cos(Y) + cos(Z)); 
[data]= meshgrid(D,D,D); 

% plot the data
figure(1)
scatter3(X(:), Y(:), Z(:), 20, data(:), 'filled')
set(gca, 'FontName', 'Times New Roman', 'FontSize', 14)
xlabel('X')
ylabel('Y')
zlabel('Z')
colorbar

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值