?? lcr_sim.m
字號:
%--------------------------------------------------------------------
% lcr_sim.m ---------------------------------------------------------
%
% Program for the computation of the level-crossing rate N(r).
%
%--------------------------------------------------------------------
% N_r=lcr_sim(xi_t,r,T_sim,PLOT)
%--------------------------------------------------------------------
% Explanation of the input parameters:
%
% xi_t: deterministic process or time-domain signal to be analysed
% with respect to the level-crossing rate N(r)
% r: level vector
% T_sim: duration of the simulation
% PLOT: plot of the resulting level-crossing rate N(r), if PLOT==1
function N_r=lcr_sim(xi_t,r,T_sim,PLOT)
if nargin==3,
PLOT=0;
end
N_r=zeros(size(r));
for k=1:length(r),
N_r(k)=sum(xi_t(2:length(xi_t)) < r(k) & ...
xi_t(1:length(xi_t)-1) >= r(k) );
end
N_r=N_r/T_sim;
if PLOT==1,
plot(r,N_r,'yx')
xlabel('r')
ylabel('N(r)')
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -