%% Generate Markov Chain from Random Transition Matrix
% Generate a six-state Markov chain from a random transition matrix.

rng(1); % For reproducibility
mc = mcmix(6);

% mc is a dtmc object.
%
% Display the transition matrix.

mc.P

%
% Plot a digraph of the Markov chain. Specify coloring the edges according to the probability of transition.

figure;
graphplot(mc,'ColorEdges',true);

% Copyright 2012 The MathWorks, Inc.