Ben Niehoff's suggestion is almost the same as Sangreda's. In order to efficiently evaluate the sum Sangreda gives, you really need to use a diagonal matrix. Unfortunately, not every matrix is diagonalizable and you have to use "Jordan Normal Form" which leads to a much more complicated formula.
Also to prove Ben Niehoff's formula, you can use the Taylors series for ex. If A = PDP-1, where D is diagonal, note that [itex]A^2= (PDP^{-1})^2= (PDP^{-1})(PDP^{-1})= PD(P^{-1}P)DP^{-1}= PD^2P^{-1}[/itex]. Then [itex]A^3= (PDP^{-1})^3= (PDP^{-1})^2(PDP^{-1})= PD^3P^{-1}[/itex] and you can prove generally (by induction) that [itex]A^n= (PDP^{-1})^n= PD^nP^{-1}[/itex].
Then
[tex]e^A= I+ A+ \frac{1}{2}A^2+ \cdot\cdot\cdot+ \frac{1}{n!}A^n+ \cdot\cdot\cdot[<br />
[tex]= I+ PDP^{-1}+ \frac{1}{2}(PDP^{-1})^2+ \cdot\cdot\cdot+ \frac{1}{n!}(PDP^{-1})^n+ \cdot\cdot\cdot[/tex]<br />
[tex]= (PP^{-1})+ PDP^{-1}+ /frac{1}{2}(PD^2P^{-1})+ \cdot\cdot\cdot+ \frac{1}{n!}+ PD^nP^{-1}+ \cdot\cdot\cdot[/tex]<br />
[tex]= P(I+ D+ \frac{1}{2}D^2+ \cdot\cdot\cdot+ \frac{1}{n!}D^n+ \cdot\cdot\cdot)P^{-1}[/tex]<br />
[tex]= Pe^DP^{-1}[/tex]<br />
and e<sup>D</sup> is just the diagonal matrix with e^{a} on the diagonal where a is a diagonal element of D.<br />
<br />
With that "i" you might find it better to use [itex]e^{iA}= cos(A)+ i sin(A)[/itex]. You can find cos(A) and sin(A) by using their Taylor series in exactly the same way: if A is diagonalizable- [itex]A= PDP^{-1}[/itex], then cos(A)= Pcos(D)P^{-1}, sin(A)= Psin(D)P^{-1}. Of course, cos(D) is the diagonal matrix with diagonal elements cos(a) for every a on the diagonal of D and sin(D) is the diagonal matrix with diagonal elements sin(a) for every a on the diagonal of D.[/tex]