matlab找缺口,Matlab生成的网络图有缺口如何解决

[X_n,Y_n,Z_n,R_max,Radius,deltaPhi] = Calc_XYZ_Coords_Template(0,10,30,30,1,3595897);

%用脚本调用以上函数

function [X_n,Y_n,Z_n,R_max,Radius,deltaPhi] = Calc_XYZ_Coords_Template(X_min,X_max,NX_pnts,Nphi_pnts,Plot_Geom,Student_ID)

%

% Function which calculates (x,y,z) coordinates of nodes of panels of the body

% Uses Function Get_Body_Radius_Vs_X to get radius corresponding to x vector

% INPUT

%     - X_min:      Minimum value for the 2D array X_n

%     - X_max:      Maximum value for the 2D array X_n

%     - Nx_pnts:    Number of points in x-direction for output arrays

%     - Nphi_pnts:  Number of points in azimuthal direction for arrays

%     - Plot_Geom:  Function MUST Plot body geometry if this variable is true

%     - Student_ID: Student ID number (without the 搒? to get radius with x

%                   Use 's' to generate sphere coordinates: useful for testing

% OUTPUT

%     - X_n:        2D array with x coordinate of each node.

%     - Y_n:        2D array with y coordinate of each node.

%     - Z_n:        2D array with z coordinate of each node.

%     - R_max:      scalar with the maximum value of the body radius

deltaX = (X_max - X_min)/(NX_pnts - 1);

X_n = X_min:deltaX:X_max;

Radius = Get_Body_Radius_Vs_X(X_n,Student_ID); %deltaPhi

%plot(X_n,Radius);

R_max = max(Radius);

deltaPhi = 2 * pi/Nphi_pnts;                 %deltaPhi

for i = 1:NX_pnts;

for j = 1:Nphi_pnts;

X_n(i,j) = (i-1)*deltaX;

Y_n(i,j) = Radius(i)*sin((j-1)*deltaPhi);

Z_n(i,j) = Radius(i)*cos((j-1)*deltaPhi);

end

end

mesh(X_n,Y_n,Z_n);

%以上是函数代码

捕获.PNG

(92.03 KB, 下载次数: 0)

2018-5-22 14:09 上传

442a53943febe9465fc072b4fbe10813.gif

b2a5a3e0dcc7d508e00275fe42fce1b5.gif

要求生成的图

dd50273c0926799eadc6239243981af0.png

我生成的图.PNG

(134.62 KB, 下载次数: 0)

2018-5-22 14:10 上传

442a53943febe9465fc072b4fbe10813.gif

b2a5a3e0dcc7d508e00275fe42fce1b5.gif

我生成的1

14447025fd3af62d65a193106dcf8169.png

我生成的图2.PNG

(148.81 KB, 下载次数: 0)

2018-5-22 14:10 上传

442a53943febe9465fc072b4fbe10813.gif

b2a5a3e0dcc7d508e00275fe42fce1b5.gif

我生成的2

e21cdd9b7235e4c26eb18b808495a4ee.png

f5c3d56501a3d0261ce0cb81cbf824a7.gif

2018-5-22 14:13 上传

点击文件名下载附件

1.49 KB, 下载次数: 2

函数

f5c3d56501a3d0261ce0cb81cbf824a7.gif

2018-5-22 14:13 上传

点击文件名下载附件

477 Bytes, 下载次数: 2

脚本

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值