meansq.m

来自「Matlab communication toolbox.」· M 代码 · 共 27 行

M
27
字号
function y = meansq(x)

% MEANSQ ...... Mean-Square value, E[X^2].  
%
%	MEANSQ(X)  For vectors,  MEANSQ(X)  is the mean-square
%		value of the elements in vector  X.  
%		For matrices,  MEANSQ(x) is a row vector containing 
%		the mean-square value of each column.
%
%	See also MEAN. VAR, STD.

%	AUTHORS : M. Zeytinoglu & N. W. Ma
%             Department of Electrical & Computer Engineering
%             Ryerson Polytechnic University
%             Toronto, Ontario, CANADA
%
%	DATE    : August 1991.
%	VERSION : 1.0

%===========================================================================
% Modifications history:
% ----------------------
%	o	Tested (and modified) under MATLAB 4.0/4.1 08.16.1993 MZ
%===========================================================================

y = var(x) + (mean(x).^2);

⌨️ 快捷键说明

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