format compact A = mark(5); A = spones(A); A = spdiags(zeros(15,1),0,A); M = expm(A); d = diag(M) d = 2.5300 3.5429 3.5822 3.2161 1.6467 3.5429 4.9227 4.6048 2.5783 3.5822 4.6048 2.6604 3.2161 2.5783 1.6467 A = load('ex02') {Error using load Unable to read file 'ex02': no such file or directory.} ls A4.31 Lmat1 ex01.m A4.40 TopSort.m ex02Mat A5.10 TopSort2.m index.html A5.12 cmdown mark.m DepthSolv.m cmup markT.m Feb11 demo3.m test.m Feb18 dfs.m Feb20 dfs2.m A = load('ex02Mat') A = 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 [Lst, Mark] = dfs(1,A, [], zeros(7,1)) Lst = 7 Lst = 4 7 Lst = 6 4 7 Lst = 3 6 4 7 Lst = 5 3 6 4 7 Lst = 2 5 3 6 4 7 Lst = 1 2 5 3 6 4 7 Lst = 1 2 5 3 6 4 7 Mark = 1 1 1 1 1 1 1 [Lst, Mark] = dfs(3,A, [], zeros(7,1)) Lst = 7 Lst = 4 7 Lst = 6 4 7 Lst = 3 6 4 7 Lst = 3 6 4 7 Mark = 0 0 1 1 0 1 1 A = load('A5.12') A = 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 5 0 5 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 0 8 0 0 0 0 0 0 0 0 0 0 9 0 0 0 0 0 0 0 0 10 0 0 10 0 0 0 0 0 0 0 0 0 0 11 0 0 0 0 b = zeros(11,1); b(3) = 1; b(7)=1; [Lst M] = TopSort2(A,b) Lst = 5 Lst = 3 5 Lst = 10 3 5 Lst = 11 10 3 5 Lst = 7 11 10 3 5 Lst = 7 11 10 3 5 M = 0 0 1 0 1 0 1 0 0 1 1 x = DepthSolv(A, b, Lst) x = 0 0 1 0 -5 0 1 0 0 -10 -11 x+L*x -b {Error using * Inner matrix dimensions must agree.} x+A*x -b ans = 0 0 0 0 0 0 0 0 0 0 0 x x = 0 0 1 0 -5 0 1 0 0 -10 -11 diary off