I am coming to julia from MATLAB and find myself startled at the idea that there isnt a better way to solve this: 1-[.5 .2 1] in julia does not compute to [0.5 0.8 0]
1-[.5 .2 1] MATLAB-> [0.5 0.8 0]
While in julia the best I got is:
-(-[.5 .2 1].+1) julia-> [0.5 0.8 0]
What am I missing? Thanks in advance
As Andre Wildberg said, use broadcasting:
For more information about broadcasting, check the docs (here and here).