view general/numerical/array/nary.m @ 42:ae596261e75f

Various fixes and development to audio handling
author samer
date Tue, 02 Dec 2014 14:51:13 +0000
parents db7f4afd27c5
children
line wrap: on
line source
% nary - return array contain nary sequece over N columns
%
% nary :: M:natural, N:natural -> [[M^N,N]->1..M].

function B=nary(M,N)

if (N==1), B=(1:M)';
else
	b=nary(M,N-1);
	m=size(b,1);
	B=[ kron((1:M)',ones(m,1)), repmat(b,M,1)];
end