% mt_resample - Sample or resample melody triangle transition matrices of given size
%
% mt_resample ::
%    mt_system  ~'initial system'
%    natural    ~'size of transition matrices to resample'
% -> action mt_system.
%
% A new set of transition matrices will be sampled and a 3D information space
% scatter plot generated in the figure determined by the initial call to
% mt_init.

function Sys=mt_resample(Sys,K)
	[TT, II] = Sys.sample_transmats(K);
	figure(Sys.fig); % 'name','info space'); 
	Sys.transmats{K} = TT;
	Sys.info{K}      = II;
	Sys.hScat{K}     = scatc(II,II(:,3),16); 
	axis on; box on; grid off; 
	lc=[0.4,0.4,0.4];
	set(gca,'Color','none');
	set(gca,'XColor',lc);
	set(gca,'YColor',lc);
	set(gca,'ZColor',lc);
	xlabel('entropy rate');
	ylabel('redundancy');
	zlabel('pred-info rate');
	rotate3d on;
end
