d = 100; i = 100; A = zeros(d,d) + 0.01; B = zeros(d,d) + 1; C = zeros(d,d) + 10; for(s = 1:i) B = B * A; C = C * A; end C = C + B;