%% Suppress State Labels
% Create a "dumbbell" Markov chain containing 10 states in each "weight" and three states in the "bar."
% Specify random transition probabilities between states within each weight.
% If the Markov chain reaches the state in a weight that is closest to the bar, then specify a high probability of transitioning to the bar.
% Specify uniform transitions between states in the bar.

rng(1); % For reproducibility
w = 10;                              % Dumbbell weights
DBar = [0 1 0; 1 0 1; 0 1 0];        % Dumbbell bar
DB = blkdiag(rand(w),DBar,rand(w));  % Transition matrix

% Connect dumbbell weights and bar
DB(w,w+1) = 1;                       
DB(w+1,w) = 1; 
DB(w+3,w+4) = 1; 
DB(w+4,w+3) = 1;

db = dtmc(DB);

%
% Plot a directed graph of the Markov chain. Return the plot handle.

figure;
h = graphplot(db);

%
% Observe that the state labels are difficult to read. Remove the labels entirely.

h.NodeLabel = {};

% Copyright 2012 The MathWorks, Inc.