% mt_ensure - Ensure that Melody Triange system includes transmats of given size
%
% mt_ensure ::
%    mt_system   ~'melody triangle system',
%    K:natural   ~'desired size of transition matrices'
% -> action mt_system.
%
% If the system already contains transition matrices of size K, then it is
% returned unchanged. Otherwise, a set of transition matrices is sampled using
% the parameters supplied to mt_init. If sampling is done, a scatter plot
% will be generated as a side effect.

function Sys=mt_ensure(Sys,K)
	if length(Sys.transmats)<K || isempty(Sys.transmats{K})
		Sys=mt_resample(Sys,K);
	end
end
