Mercurial > hg > trimatlab
diff mt_ensure.m @ 0:be936975f254
Initial check in.
author | samer |
---|---|
date | Wed, 01 Feb 2012 14:06:37 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mt_ensure.m Wed Feb 01 14:06:37 2012 +0000 @@ -0,0 +1,17 @@ +% 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