title: Calculating exp() of each element in matrix using R
body: <p>how can I take exp() of each element in a matrix? I have <code>mymatrix = matrix(c(2, 4, 3, 1, 5, 7), 3,2)</code> and tried using <code>res&lt;-expm(mymatrix)</code> but it requires <code>mymatrix</code> to be square. Is there another way to calculate each element so
  res is <code>matrix(c(exp(2), exp(4), exp(3), exp(1), exp(5), exp(7), 3,2)</code> ?</p>