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:


1 Like

I guess you want to read in particular.

1 Like

Thanks so much this helps a lot :slight_smile: