base.m

来自「无线传感器网络节点寿命」· M 代码 · 共 37 行

M
37
字号
clear all

R=20*60;         %the update period
H=10;            %the water depth
Et=32.4;
d=1000;
f=50;

alpha=0.504*f-11.2;
        
TL=10*log10(d)+alpha*d*10^(-3);
        
SL=TL+85;
        
It=10^(SL/10)*0.67*10^(-18);
        
Pt=2*pi*H*It;
        
for M=1:500
    for i=1:M
        
        Pframe(i)=1.23*Pt*(M-i+1)*(1+1/5+1/5+1/25);
        
    end
    PCTR(M)=sum(Pframe)/(1000*M);
    
    Tactive=Et/Pframe(1);
        
    Ttotal=1.23*(M+M/5);
        
    Tlifetime(M)=Tactive/Ttotal*R/24;
end

M=1:500;
semilogy(M,PCTR);
%semilogy(M,Tlifetime);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?