Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5426 > unrolled thread
| Started by | Sseziwa Mukasa <mukasa@gmail.com> |
|---|---|
| First post | 2011-10-06 08:24 +0000 |
| Last post | 2011-10-06 08:24 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Thread::tdlen: Objects of unequal length Sseziwa Mukasa <mukasa@gmail.com> - 2011-10-06 08:24 +0000
| From | Sseziwa Mukasa <mukasa@gmail.com> |
|---|---|
| Date | 2011-10-06 08:24 +0000 |
| Subject | Re: Thread::tdlen: Objects of unequal length |
| Message-ID | <j6joj6$m4o$1@smc.vnet.net> |
The operator for matrix multiplication is . not *, * is for element by element multiplication.
Incidentally, . actually does tensor multiplication (read the help) so the braces are unnecessary you can do:
{x1,x2,x4,x4}.{{...}}.{x1,x2,x3,x4}
which will result in a scalar, unless you really want a two dimensional 1x1 result in which case s must be two dimensional.
Regards,
Sseziwa
On Oct 5, 2011, at 4:04 AM, SysInv wrote:
> This problem is driving me crazy. I'm trying to multiply matrices, where one is 1x4 (s) and the other is 4x4 (t) and the multiplication is s*t*Transpose[s]
>
> Despite this I get the error message that the objects is of unequal length. The matrices are:
>
> s={{x1,x2,x3,x4}}
>
> =
t={0.0284435,0.00395759,0.000211963,0.0357403},{0.00395759,0.0113862,-0.000199939,-0.000556137},{0.000211963,-0.000199939,0.00118147,-0.00043913},{
> 0.0357403,-0.000556137,-0.00043913,0.0649449}
>
> I must use double level in the 1 row matrix, since otherwise Transpose[] complains that it needs at least 2 levels. I tried without this as well, but I keep getting:
>
> Thread::tdlen : Objects of unequal length in {{x1,x2,x3,x4}}{{0.0284435,0.00395759,0.000211963,0.0357403},<<2>>,{<<10>>,<<3>>}}{{x1},{x2},{x3},{x4}} cannot be combined. >>
>
> . when I run s*t*Transpose[s].
>
> I've spent hours trying to figure this simple problem out, but without any luck. Any pointers guys? It doesn't help if I change the order of the transpose...
>
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web