in reply to Why dies this work in matlab and not PDL?

Ok, first of all I must apologise I realise now one of matrix dimensions were incorrect.
Anyway ... given the matrices A = 71 x 35 B = 35 x 35 C = 35 x 7 D = 7 x 7
The matrix multiplication should be I hope
(71x35) x (35 x 35) x (35 X 7) x (7 x 7)
or
A x B x C x D
But it doesnt work. Any suggestions much appreciated.

Replies are listed 'Best First'.
Re^2: Why does this work in matlab and not PDL?
by Roy Johnson (Monsignor) on Sep 20, 2005 at 14:13 UTC
    Have you tried breaking it up into one multiplication at a time?
    $X = $A x $B; $X = $X x $C; $X = $X x $D;
    That should tell you (at least) which of the multiplications PDL thinks has the wrong dimensions. Is it possible to have PDL tell you what dimensions it thinks each variable has?

    Caution: Contents may have been coded under pressure.
      This shouldn't be necessary. Matrix multiplication is associative, meaning that A x (B x C) == (A x B) x C, so it really shouldn't matter in which order PDL is evaluating the multiplications. However, given that there is an error at all would suggest that there's something else going on and I do agree with your approach to debugging it. :)

      thor

      Feel the white light, the light within
      Be your own disciple, fan the sparks of will
      For all of us waiting, your kingdom will come