⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dmstd.m

📁 JLAB is a set of Matlab functions I have written or co-written over the past fifteen years for the p
💻 M
字号:
function[sig]=dmstd(L,K,S)% DMSTD Computes standard deviation from discrete-mode formulation.%  %   SIG=DMSTD(L,K,S), where L is a scalar, K is a array of complex-%   valued wavenumbers, S is an array of the same size as K containing%   the corresponding values of the spectrum, returns the standard%   deviation.%%   S and K may also be of different sizes, but with the size of S%   "compatible" with that of K. In this case DMSTD will return a %   row vector whose length is NUBSLABS(S,K), e.g. the number of %   time steps.  SIG must then have the same length (or length 1).%%   See also ISCOMPAT, DMSPEC, DMASYM, DMSKEW.%%   Usage: sig=dmstd(L,k,S);%%   'dmstd --t' runs a test. %   __________________________________________________________________%   This is part of JLAB --- type 'help jlab' for more information%   (C) 2002--2006 J.M. Lilly --- type 'help jlab_license' for details      if strcmp(L, '--t')  dmstd_test,returnendif ~iscompat(S,K)  error('The size of S must be compatible with that of K.  See ISCOMPAT.')endS=reshape(S,numel(K),numslabs(S,K));fact=frac(1,L^2);%Note two factors of (2 pi)^2 cancel each othersig=sqrt(sum(fact.*S,1));  function[]=dmstd_testreporttest('DMSTD one wave of unit amplitude', aresame(dmstd(1,[3 3],[1 1]),sqrt(2),1e-6));

⌨️ 快捷键说明

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