Computer Vision News - October 2020
Plots On almost every scientific work a plot is the most important element. Julia has a very extensive way of operating with plotting libraries, using plotly interfaces or even python packages. An example is shown below: Julia 25 # this is a range a4 = 1:10 printsum(a4) #> 10-element UnitRange{Int64}: 1:10 # but ranges can be used to create also arrays a4 = collect(1:10) printsum(a4) #> 10-element Array{Int64,1}: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] # similarly comprehensions can be used to create arrays a5 = [2 ^ i for i = 1:10] printsum(a5) #> 10-element Array{Int64,1}: [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024] # arrays can be any type, so arrays of arrays can be created: a6 = (Array{ Int64 , 1})[] printsum(a6) #> 0-element Array{Array{Int64,1},1}: Array{Int64,1}[] # the one above is an array of an array NOT a multi-dimensional array (which is also possible # Functions of ‘dequeue’ type are also provided such as push to append in the end of arrays # ! is used to show that the first argument is updated push ! (a1, 4) printsum(a1)
Made with FlippingBook
RkJQdWJsaXNoZXIy NTc3NzU=