Hello. This is my first post on here. I am doing some work with arrays for a small simulator. I have noticed that multiplication dot functions work fine but addition and trig functions do not.
Example where all is well:
Input:
TryArray = Array[1:30,1:30]
TryArray .* 2
Output:
2-element Array{Array{Int64,1},1}:
[2, 4, 6, 8, 10, 12, 14, 16, 18, 20 … 42, 44, 46, 48, 50, 52, 54, 56, 58, 60]
[2, 4, 6, 8, 10, 12, 14, 16, 18, 20 … 42, 44, 46, 48, 50, 52, 54, 56, 58, 60]
Example where all is not well:
Input:
TryArray = Array[1:30,1:30]
TryArray .+ 2
Output:
MethodError: no method matching +(::Array{Int64,1}, ::Int64)
Closest candidates are:
+(::Any, ::Any, !Matched::Any, !Matched::Any...) at operators.jl:529
+(!Matched::Complex{Bool}, ::Real) at complex.jl:301
+(!Matched::Missing, ::Number) at missing.jl:115
...
Stacktrace:
[1] _broadcast_getindex_evalf at .\broadcast.jl:631 [inlined]
[2] _broadcast_getindex at .\broadcast.jl:604 [inlined]
[3] getindex at .\broadcast.jl:564 [inlined]
[4] copy at .\broadcast.jl:854 [inlined]
[5] materialize(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Nothing,typeof(+),Tuple{Array{Array,1},Int64}}) at .\broadcast.jl:820
[6] top-level scope at In[18]:2
sin.(TryArray) and broadcast(+,1,(TryArray,)) produce similar results. I am not sure why the method does not match. Could someone help me understand what is missing? Thanks!