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 vectorvwith the elements1,2, and3.julia> v- This part prints the vectorvto 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 get JuliaLang version?
- How to work with CSV in JuliaLang?
- How to append to an array in JuliaLang?
- How to create a histogram in JuliaLang?
- How to sort in JuliaLang?
- How to use regular expressions in JuliaLang?
- How to calculate the mean in JuliaLang?
- How to add a legend to a plot in JuliaLang?
- How to use the JuliaLang PackageCompiler?
See more codes...