Mercurial > hg > trimatlab
view private/addkbcallback.m @ 11:0e0f2805ef9c
Added new mechanism for checking Markov chains for uniqueness of stationary distribution;
new supporting files and new parameters to mt_init (see CHANGES).
Some functions require greater Matlab library, not included.
author | samer |
---|---|
date | Sun, 26 Feb 2012 23:11:10 +0000 |
parents | |
children |
line wrap: on
line source
function addkbcallback(fig,handler) % addkbcallback - Add keypress handler to figure or remove all handlers if nargin>1, cb=get(fig,'KeypressFcn'); if isempty(cb) set(fig,'KeypressFcn',{@kpcb,{handler}}); else set(fig,'KeypressFcn',{cb{1},[cb{2},{handler}]}); end else set(fig,'KeypressFcn',[]); end end function kpcb(a,b,handlers), for i=1:length(handlers), h=handlers{i}; h(b); end; end