view general/discretise/data2maps.m @ 42:ae596261e75f

Various fixes and development to audio handling
author samer
date Tue, 02 Dec 2014 14:51:13 +0000
parents e44f49929e56
children
line wrap: on
line source
function M=data2maps(RFn,X,N)
% data2maps - build linear maps for covering data ranges
%
% data2maps :: 
%    ([[N,M]] -> [[2,M]]) ~ 'function to compute min and max of range',
%    [[N,M]]              ~ 'the data'
%    L:natural            ~ 'number of bins in output maps'
% -> { [M] -> dmap(L) }   ~ 'one dmap per column in a cell array'.
%
% Two argument version computes L=sqrt(N)
%
% data2maps :: 
%    ([[N,M]] -> [[2,M]]) ~ 'function to compute min and max of range',
%    [[N,M]]              ~ 'the data'
% -> { [M] -> dmap(L) }   ~ 'one dmap per column in a cell array'.

if nargin<3, N=sqrt(size(X,1)); end
M=maprows(@(r){linmap(r(1),r(2),N)}, closed2hopen(feval(RFn,X)'));