绘制椭圆体的横截面等值线图(如corel图所示)

时间:2017-07-20 17:30:05

标签: matlab plot 3d matlab-figure

这是我使用slice命令获得的图像。无法获得更精细的网格:

This is the image I got using slice command. Can't get for finer mesh grid

此图像分别显示沿X-Y,Y-Z和X-Z平面的椭圆体周围的压力轮廓:

This image shows the pressure contours around an ellipsoid along X-Y, Y-Z, and X-Z planes separately.

我使用MATLAB绘制这些图表。我想在椭圆体的单个三维图中显示所有这些平面。可以使用MATLAB或任何其他平台完成吗?

% 3D meshgrid in clast's coordinate
    xgv     = 0;           % grid vector: x'axis,a1
    ygv     = -8:0.1:8;           % grid vector: y'axis,a2
    zgv     = -6:0.1:6;    % grid vector: z'axis,a3
    [X,Y,Z] = meshgrid(xgv,ygv,zgv);



    % Exterior points
    ind   = (X./1).^2 + (Y./a(2)).^2 + (Z./a(3)).^2 > 1;
    x_ex  = X(ind);
    y_ex  = Y(ind);
    z_ex  = Z(ind);
    ep    = cat(1,x_ex',y_ex',z_ex');
    % total points number
    num   = numel(X);
    % exterior points number
    [~,n] = size(ep);


    % Exterior Fields  
    % 
      G = Ex_Gtensor(a,ep); % this is some function to calculate pressure at 
               external points
      Here I use some algorithm to calculate pressure field outside ellipsoid.
    %--------------------------------------------------
    pressure        = zeros(num,1);
    pressure(~ind)  = p1;
    pressure(ind)   = p2;
    % So this pressure variable has all the pressure values for all external points 
    pressure        = reshape(pressure,size(squeeze(Z)));


    contourf(squeeze(Y),squeeze(Z),pressure)
    hold on
    axis equal
    % Similarly I use this code for X-Y and X-Z plane.

如果需要任何其他信息,请告诉我。 提前谢谢!

0 个答案:

没有答案