%% Visualize Markov Chain Mixing Time
% Create a 50-state Markov chain from a random transition matrix in which most of the transitions are infeasible and randomly placed.

rng(1) % For reproducibility
mc = mcmix(50,'Zeros',2400);

% Visualize the mixing time of the Markov chain by plotting a digraph and specifying node colors representing the expected first hitting times for state 1, beginning from each state.

hittime(mc,1,'Graph',true);

% Visualize the mixing time of the Markov chain for state 5.

hittime(mc,5,'Graph',true);

% Copyright 2019 The MathWorks, Inc.