2 ms·
Julia takes after Matlab, where matrices are defined by enumerating each row followed by a semicolon. Personally I prefer Mathematica's syntax, but the Julia/Ma
by throwawaymath 7y ago
Julia takes after Matlab, where matrices are defined by enumerating each row followed by a semicolon. Personally I prefer Mathematica's syntax, but the Julia/Matlab syntax is still way better than Numpy syntax (though to be fair most of that is due to the lack of native matrix support in Python).
If it helps at all, this is exactly what you'll see when you create a matrix in Julia:
julia> mat = [1 2; 3 4]
2×2 Array{Int64,2}:
1 2
3 4
- dnautics 7y agoFYI you can also do this julia> mat = [1 2 3 4]
- throwawaymath 7y agoOh that's neat. Thanks, I wasn't aware of that.