A = [ [0 -1] ; [1 0] ] e_to_the_A = [ [cos(1) -sin(1) ] ; [ sin(1) cos(1) ] ] s=zeros([2 2]) for i=0:5 s = s + A^i/factorial(i); % semicolons prevent output end s s - e_to_the_A s=zeros([2 2]) for i=0:10 s = s + A^i/factorial(i); % semicolons prevent output end s s - e_to_the_A