Or (closer to your question):

*julia> **X=myfn()*

*([1,2,3],[4,5])*


*julia> **a1,a2 = X*

*([1,2,3],[4,5])*



On Wed, Nov 18, 2015 at 6:56 AM, Adrian Cuthbertson <
[email protected]> wrote:

> You can also just return your (array or any other) variables as a comma
> separated list which will return them as a tuple. Then "capture" them again
> as a tuple on the calling side. E.g
>
> julia> myfn() = [1:3],[4:5]
>
> myfn (generic function with 2 methods)
>
> julia> (x1,x2) = myfn()
> ([1,2,3],[4,5])
>
> julia> x1
>
> 3-element Array{Int64,1}:
>
>  1
>
>  2
>
>  3
>
>
>
> On Wed, Nov 18, 2015 at 12:37 AM, Eric Forgy <[email protected]> wrote:
>
>> Coming from Matlab, I recently had the same question. Have a look at
>> Dict. For speed, you may want to define new types, but for a quick "struct"
>> equivalent, you can try Dict.
>>
>>
>> On Wednesday, November 18, 2015 at 6:37:44 AM UTC+8, Jason McConochie
>> wrote:
>>>
>>> Thank you. Perfect with defining the type after as
>>> someArray1::Vector{Float64}
>>>
>>> On Tuesday, November 17, 2015 at 11:16:08 PM UTC+1, Benjamin Deonovic
>>> wrote:
>>>>
>>>> You can use types:
>>>>
>>>> type myResult
>>>>   someArray1::Vector
>>>>   someArray2::Vector
>>>> end
>>>>
>>>>
>>>>
>>>> On Tuesday, November 17, 2015 at 4:06:10 PM UTC-6, Jason McConochie
>>>> wrote:
>>>>>
>>>>> In matlab I group arrays into structures such that I can deal with one
>>>>> variable as the output from the function
>>>>> e.g.
>>>>> function o=someFunction(in)
>>>>> o.someArray1=[0,0,0,0];
>>>>> o.someArray2=[1,1,1,1];
>>>>> end
>>>>>
>>>>> What is the Julia equivalent?  Maintaining the efficiency of the
>>>>> contiguous columnar array access in Julia.
>>>>>
>>>>
>

Reply via email to