Question about Types

a=convert(Vector{Float64},rand(20))

image
image
In Workplace it is of type Vector, but in REPL it is of type Array. Why is that?Thank you very much!

Hi,

A Vector is just an alias for a one dimensional Array:

julia> Vector == Array{T,1} where T
true

julia> Array{Int,1}(undef,1)
1-element Array{Int64,1}:
 140523564301152

julia> Vector{Int}(undef,1)
1-element Array{Int64,1}:
 140524253304528

But I just need the vector format, so how do I do that?

What you mean by vector format. What do you want to do?

asd=convert(Vector{Float64},rand(20))

I need the asd to be a vector type, but the convert function doesn’t do that, so what do I do?

Vector{Float64} is the same type as Array{Float64, 1}, the workspace displays Array{Float64, 1} as Vector{Float64} because they are the same thing and it is easier to tell at a glance to tell what it is.

It does. There’s no difference between Vector{Float64} and Array{Float64,1}

thankyou!

ok,got it!

No need to convert then.