% FSM( s, L) - produce state matrix for L-state FSM with symbols s
%
function states = FSM( s, L)

nsyms = size(s,2);	% columns(s)

nstates = prod( nsyms*ones(1,L));	% nstates = nsyms ** L

states = zeros( L, nstates);

c = ones( 1, L);

for i = 1:nstates
  states(:,i) = s(c)';
  % c = FSM_inc( c, nsyms);
  FSM_inc_C( c, nsyms);
end
