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 test code in JuliaLang?
- How to work with matrices in JuliaLang?
- How to append to an array in JuliaLang?
- How to use the println function in JuliaLang?
- How to work with rational numbers in JuliaLang?
- How to use try catch in JuliaLang?
- How to measure execution time in JuliaLang?
- How to sort in JuliaLang?
- How to fill an array in JuliaLang?
- How to create dataframes in JuliaLang?
See more codes...