1

If I have a Matrix say A = [0.64 0.42; 0.42 0.97] in Matlab, why does sin(A) give me a different result than funm(A, @sin)? I would expect them to be the same?

Mr.Wizard
  • 24,179
  • 5
  • 44
  • 125
Maggick
  • 763
  • 2
  • 10
  • 26
  • [`funm`](http://www.mathworks.co.uk/help/matlab/ref/funm.html) isn't [`arrayfun`](http://www.mathworks.co.uk/help/matlab/ref/arrayfun.html) I'm not familiar with Matrix Functions but they appear to be very different to elementwise operations. – Notlikethat Feb 18 '14 at 01:29

1 Answers1

1

The funm(A,@sin) call performs a matrix sin operation, which is a different operation from the sin(A) call, which performs the sin of each individual entry in the matrix. The matrix sin is instead performed by computing a power series as defined here:

http://www.johndcook.com/blog/2008/03/14/what-is-the-cosine-of-a-matrix/

This page also provides a good discussion about what a matrix sin is used for, and how it differs from the sin of an individual element.

ewz
  • 423
  • 2
  • 5