samer@21: % zeromax - additive normalisation so max value us zero samer@4: % samer@21: % zeromax :: samer@21: % [D:[[E]]] ~'E dimensional array of size D', samer@21: % 1..D ~'dimension to normalise along' samer@21: % -> [D] ~'shifted data'. samer@21: % samer@21: % non-finite values are ignored. Dimension defaults to 1. samer@21: function [y,m]=zeromax(x,dim), x=addnorm(@(y)max(y,[],dim),x); end