Demo entry 6776337

M

   

Submitted by anonymous on Dec 02, 2018 at 07:17
Language: Matlab. Code size: 259 Bytes.

function V = f02( Aw,dz )
%该函数用于计算排水体积
%Aw——水线面面积,dz——水线间距
%V——排水体积

Aw1 = Aw;
Aw2 = Aw;
Aw1(1,:)=[];    %去掉Aw第一行
Aw2(end,:)=[];  %去掉Aw最后一行
Aw12=Aw1+Aw2;   %对应计算表格中的“成对和”

Aw12_sum=cumsum(Aw12,1);    %对应计算表格中的“自上而下之和”

V=0.5*dz*Aw12_sum;  %计算排水体积

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).