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

📄 zeroavg.m

📁 基于matlab的各种EOF分解程序
💻 M
字号:
function [N,Ma]=zeroavg(M,c)

% function [N,Ma]=zeroavg(M,c)
%
% This function computes the average of each column of a matrix M
% and subtracts it % from every entry in that column. 
% If the column contains a time % serie, the time serie will become 
% zero averaged. 
%
% If an extra argument "c"
% is passed to the function 
% (independent of its value) the averageing will
% not be performed over its columns bit over its rows.
% The zero averaged matrix is returns in matrix N.

[p,q]=size(M);

if nargin == 1
   Ma=sum(M)/p;
   N = M - repmat(Ma,p,1);
end
if nargin>1
   Ma=(sum(M')/q)';
   N=M-repmat(Ma,1,q);
end

⌨️ 快捷键说明

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