How to apply a function only to the second column of a matrix

How about @views m[:,2] .= sin.(m[:, 2]). This will also work without the @views but then will be making a copy with m[:, 2].

1 Like