November 2017
Beginner
316 pages
6h 40m
English
In the preceding section, we worked with arrays and operations on them. It is also possible to create two-dimensional arrays or matrices. There is a small difference in the syntax that helps to create these matrices:
# this will create an arrayjulia> X = [1, 1, 2, 3, 5, 8, 13, 21, 34]9-element Array{Int64,1}: 1 1…# constructing a matrixjulia> X = [1 1 2; 3 5 8; 13 21 34]3×3 Array{Int64,2}: 1 1 2 3 5 813 21 34
The difference is that we didn’t provide "," (comma) between the elements and separated the rows of the matrix using a ";" (semicolon). This type of indexing is called column order.
Read now
Unlock full access