Use the ...

julia> A = rand(4,5,6,7); B = rand(4,5,6);

julia> C = zeros(eltype(A), size(A)[1:end-1]..., size(B)[2:end]...);


On Mon, 2015-02-09 at 11:34, Yuuki Soho <[email protected]> wrote:
> I'm trying to do something very simple but I'm having no luck.
>
> I have to arrays A and B and I want to initialize an array C with dimension 
> that depend on the ones of A and B, in matlab I simply would do:
>
> sA = size(A); 
> sB = size(B); 
> C = zeros([sA(1:end-1) sB(2:end)]); 
>
> How does one do that in Julia ? I guess I could write a function and use 
> ntuple, but it feels really awkward.

Reply via email to