November 2017
Beginner
316 pages
6h 40m
English
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
1.0
1.0
1.0
However, before we move any further, we need to know the difference ...
Read now
Unlock full access