Julia is targeted toward the scientific community. Starting with this topic, we will see how Julia greatly eases mathematical calculations in the real world. We will start off by explaining how Julia proves to be a great resource for solving problems in linear algebra.
The syntax used in Julia closely resembles that of MATLAB, but there are some important differences. To begin with, look at the matrix of some randomly generated numbers:
julia> A = rand(3,3)
3×3 Array{Float64,2}:
0.821807 0.828687 0.974031
0.996824 0.805663 0.274284
0.0341033 0.224237 0.39982
The rand
function takes in parameters asking for the dimensions of the array, and as we have passed here a (3,3)
, we get an array of size 3x3 of type Float64
, containing random Gaussian numbers.
Similarly, we have another function named ones
, which takes in a single parameter and reproduces an array containing 1.0
:
julia> ones(5)
5-element Array{Float64,1}:
1.0
1.0...