"
A=rand(2,3)
cos(A) #will create error
"
what is the alternative to this
"
A=rand(2,3)
cos(A) #will create error
"
what is the alternative to this
cos(A) calculates the matrix cosine of A. If you want the cosine of each element, you can use broadcasting with . like this:
A = rand(2,3)
cos.(A)