?? energies.m
字號:
function [E,sE]=energies(P,dt,ind,wid);
% ENERGIES calculates energy from time-dependent powerspectrum
%
% [E,sE]=energies(P,dt,ind,wid);
%
% in: P time-dependent power spectrum matrix
% dt time interval in milliseconds
% ind indexes of middle-frequencies (columns of P) (default all)
% wid numbers of columns to include in total energy
% rounded to next odd integer (default [1])
%
% out: E row-matrix of energies ([Ewid(1);Ewid(2);...;Ewid(n)])
% sE string matrix of energy-values (mPa^2 * ms)
% (c) Pekka Kumpulainen 21.11.1993 (P.K. 15.2.1995)
if nargin < 3; ind= 1:size(P,2); end
if nargin < 3; wid=[1]; end
nband=length(ind);
nwid=length(wid);
E=zeros(nwid,nband);
for iw=1:nwid;
dc= floor(wid(iw)/2);
for ib=1:nband;
in=(ind(ib)-dc):(ind(ib)+dc);
E(iw,ib)=sum(sum(P(:,in)));
end
end
E=E*dt;
if nargout > 1;
s=sprintf('%3.1f|',E(1,:)*1e9);
sE=str2mat(s(1:(length(s)-1)));
for ii=2:nwid;
s=sprintf('%3.1f|',E(ii,:)*1e9);
sE=str2mat(sE,s(1:(length(s)-1)));
end
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -