Mercurial > hg > mauch-mirex-2010
view _misc/general/.svn/text-base/qnormalise.m.svn-base @ 8:b5b38998ef3b
added all that other stuff
author | matthiasm |
---|---|
date | Fri, 11 Apr 2014 15:54:25 +0100 |
parents | |
children |
line wrap: on
line source
function [outmat, scale] = qnormalise(inmat, varargin) % qnormalise(inmat, q, dim) returns the field inmat normalised by the q % norm over dimension dim dim = 1; if nargin > 1 q = varargin{1}; if nargin > 2 dim = varargin{2}; end else q = 2; end sizeInmat = size(inmat); nDim = length(sizeInmat); repeatpattern = [ones(1,dim-1) sizeInmat(dim) ones(1,nDim-dim)]; scale = qnorm(inmat, q, dim); outmat = inmat ./ repmat(scale, repeatpattern);