%% Create Markov Chain from Random Transition Matrix
% To help you explore the dtmc object functions, mcmix creates a Markov chain from a random transition matrix using only a specified number of states.
% Create a five-state Markov chain from a random transition matrix.

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

% mc is a dtmc object.
%
% Plot the eigenvalues of the transition matrix on the complex plane.

figure;
eigplot(mc)

% This spectrum determines structural properties of the Markov chain, such as periodicity and mixing rate.
% Copyright 2012 The MathWorks, Inc.