julialangHow to create a vector in JuliaLang?
Creating a vector in JuliaLang is easy. You can use the [ ]
syntax to create a vector. For example:
julia> v = [1, 2, 3]
3-element Array{Int64,1}:
1
2
3
The code above creates a vector v
with three elements: 1
, 2
, and 3
.
The code consists of two parts:
v = [1, 2, 3]
- This part creates the vectorv
with the elements1
,2
, and3
.julia> v
- This part prints the vectorv
to the console.
For more information about creating vectors in JuliaLang, see the JuliaLang documentation.
More of Julialang
- How to get JuliaLang version?
- How to test code in JuliaLang?
- How to use tuples in JuliaLang?
- How to use try catch in JuliaLang?
- How to round numbers in JuliaLang?
- How to create plots in JuliaLang?
- How to calculate the mean in JuliaLang?
- How to install JuliaLang?
- How to add a legend to a plot in JuliaLang?
- How to measure execution time in JuliaLang?
See more codes...