Maggick
Maggick

Reputation: 793

Funm @Sin VS Sin of Matrix Matlab

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?

Upvotes: 1

Views: 1513

Answers (1)

ewz
ewz

Reputation: 423

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.

Upvotes: 1

Related Questions