How to apply mathematical function on arrays and vectors and multidimensional matric



Hi guys,

I am quite new to Julia, I come form matlab background. I wanted to know how can you apply any mathematical fuunction like sine, cos or besselh to a matrix or array.

for example in matlab say you have x = rand(3,4,5) and you do y=sin(x) what you get is y a 3d matrix having dimension of (3,4,5). How can you accomplish this julia ?

y = sin.(x)

For more details see “broadcast and vectorization” in:



I guess you want to read in particular.


Thanks so much this helps a lot :slight_smile: