clears all variables: >>clear closes all plots >>close all generates a 4X4 matrix of random values >>A=rand(4); generates a 20X4 matrix of zeros x=zeros(4,20); places non-zero values in the first column of x >>x(:,1) = [0.4, 0.2, 0.1, 0.3]' x = Columns 1 through 7 0.4000 0 0 0 0 0 0 0.2000 0 0 0 0 0 0 0.1000 0 0 0 0 0 0 0.3000 0 0 0 0 0 0 Columns 8 through 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 15 through 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 iterates the map: >> for ii = 1:19 >> x(:,ii+1) = A*x(:,ii); >> end >>x(:,1:3) ans = 0.4000 0.3891 0.5919 0.2000 0.4429 0.5838 0.1000 0.3393 0.4970 0.3000 0.1415 0.2517 >>x x = Columns 1 through 7 0.4000 0.3891 0.5919 0.8788 1.2933 1.9096 2.8177 0.2000 0.4429 0.5838 0.8811 1.2966 1.9135 2.8238 0.1000 0.3393 0.4970 0.7225 1.0709 1.5790 2.3302 0.3000 0.1415 0.2517 0.3731 0.5471 0.8086 1.1929 Columns 8 through 14 4.1579 6.1356 9.0541 13.3607 19.7157 29.0935 42.9320 4.1669 6.1490 9.0737 13.3897 19.7585 29.1567 43.0252 3.4386 5.0742 7.4878 11.0493 16.3050 24.0605 35.5049 1.7604 2.5978 3.8334 5.6568 8.3474 12.3179 18.1770 Columns 15 through 21 63.3527 93.4866 137.9537 203.5719 300.4015 443.2883 654.1398 63.4903 93.6896 138.2534 204.0140 301.0540 444.2512 655.5606 52.3930 77.3138 114.0884 168.3549 248.4334 366.6016 540.9767 26.8229 39.5813 58.4083 86.1904 127.1872 187.6841 276.9567 matlab allows you to also multiply these matrices to produce the final result. >>xm = A^20*x(:,1); >>xm xm = 654.1398 655.5606 540.9767 276.9567 the results should the same for ii = 21 >>xm-x(:,21) ans = 1.0e-12 * -0.3411 -0.2274 -0.2274 0 diary off