cool, thanks!

On Monday, May 26, 2014 1:57:28 AM UTC+8, Ethan Anderes wrote:
>
> I love the ... notation. It splats the entries into separate arguments 
> separated by commas into the function. 
>
> julia> y = "abcd"
> "abcd"
>
> julia> [y...] == ['a', 'b', 'c', 'd']
> true
>
> On Sunday, May 25, 2014 10:49:05 AM UTC-7, Freddy Chua wrote:
>
> hang on, what does the "..." in hcat(a...) means
>>
>> On Monday, May 26, 2014 1:47:21 AM UTC+8, Ethan Anderes wrote:
>>>
>>> Right, hcat(a…) does that (up to a transpose since julia stores things 
>>> in column major order ).
>>>
>>> julia> a = Array(Array, 0)
>>> 0-element Array{Array{T,N},1}
>>>
>>> julia> push!(a, [1, 2])
>>> 1-element Array{Array{T,N},1}:
>>>  [1,2]
>>>
>>> julia> push!(a, [3, 4])
>>> 2-element Array{Array{T,N},1}:
>>>  [1,2]
>>>  [3,4]
>>>
>>> julia> b = hcat(a...)
>>> 2x2 Array{Int64,2}:
>>>  1  3
>>>  2  4
>>>
>>> julia> b[:, 2]
>>> 2-element Array{Int64,1}:
>>>  3
>>>  4
>>>
>>> On Sunday, May 25, 2014 10:42:38 AM UTC-7, Freddy Chua wrote:
>>>
>>> I mean, is there a function that allows me to take in a and return a 
>>>> matrix?
>>>>
>>>> b = convert_to_matrix(a)
>>>>
>>>> b[:, 2] = [2,4]
>>>>
>>>> On Monday, May 26, 2014 1:36:47 AM UTC+8, Freddy Chua wrote:
>>>>>
>>>>> For example
>>>>>
>>>>> a = Array(Array, 0)
>>>>>
>>>>> push!(a, [1, 2])
>>>>> push!(a, [3, 4])
>>>>>
>>>>> Gives me an array of array. Can I get a matrix easily in this way?
>>>>>
>>>>>
>>>>> 

Reply via email to