about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/graph/mk_adjmat_chain.m
diff options
context:
space:
mode:
Diffstat (limited to 'sourcecodes/bnt-master/graph/mk_adjmat_chain.m')
-rw-r--r--sourcecodes/bnt-master/graph/mk_adjmat_chain.m8
1 files changed, 8 insertions, 0 deletions
diff --git a/sourcecodes/bnt-master/graph/mk_adjmat_chain.m b/sourcecodes/bnt-master/graph/mk_adjmat_chain.m
new file mode 100644
index 00000000..d206b272
--- /dev/null
+++ b/sourcecodes/bnt-master/graph/mk_adjmat_chain.m
@@ -0,0 +1,8 @@
+function G = mk_adjmat_chain(T)
+% MK_DAG_CHAIN Make adjacency matrix for bi-directional Markov chain of  T nodes
+% function G = mk_dag_chain(T)
+%
+% G(t,t+1) = 1 for all t<T
+
+G = diag(ones(1,T-1),1) + diag(ones(1,T-1),-1);
+