You'll probably want to step through the code as it executes, rather than
blindly trying to translate from R and hoping it works. The interactive
experience in the REPL is quite helpful for quickly correcting things that
don't do what you expect them to.

On Mon, Aug 3, 2015 at 5:50 AM, Nils Gudat <[email protected]> wrote:

> I think you really might want to take some time to go through the
> documentation and learn some of the basics of Julia, a good starting point
> might be
> http://julia.readthedocs.org/en/latest/manual/noteworthy-differences/
>
> The first error is simply telling you that the result of 
> *broadcast(*,Pr,GI[:,1,:])
> *has dimension 4x3x3, while *F[:,1,:] *is an array of dimension 4x1x3.
> The second error says that you can't multiply a 4x1x3 array, while the
> third error says that you can't do this elementwise, either.
>
> The main problem seems to be that (e.g.) G.I[,1,] produces a 4x3 matrix in
> R, while GI[:,1,:] returns a 4x1x3 array in Julia. You need to make sure
> that the indexing you're using in Julia is actually returning the objects
> you're expecting. You should have a look at the reshape() and the squeeze()
> functions (e.g. in your second error, GI[:,2,:].*(squeeze(F[:,2-1,:],2)*Tr)
> would wok, although I'm not entirely sure that's what you're trying to
> achieve!
>

Reply via email to