| View previous topic :: View next topic |
| Author |
Message |
mbrouillet General User

Joined: 06 May 2010 Posts: 13
|
Posted: Tue Apr 19, 2011 1:11 am Post subject: Vector calculation diregards order of vectors. {A*B} = {B*A} |
|
|
I can't believe this. I make two vectors, one line and one column, and when I multiply the two I get the same result independently of the order. This is just completely wrong.
.......................C1=3
.......................C2=4
A3=1 B3=2 ..... ?
In C3 I enter the following : "=C1:C2*A3:B3" and I end it with CTRL+SHIFT+ENTER. This fills me the area C3:D4 with correct data (3 ; 6 ; 4 ; 8 ).
But if I put the following in C3 : "=A3:B3*C1:C2" and end it with CTRL+SHIFT+ENTER, I get the same result ! It should not. I should only have a 1x1 result in C3, with value 11 (3*1+4*2).
With vectors, A*B is not equal to B*A. If A is of size m*n and B of size o*p, then A*B is of size n*o while B*A is of size p*m.
This is just terrible ! Am I the only one suffering from this bug ? Am I just doing something wrong ? It seems quite incredible. OpenOffice 3.2.1 OOO320m18 (Build:9502). |
|
| Back to top |
|
 |
ken johnson Super User

Joined: 23 Apr 2009 Posts: 1851 Location: Sydney, Australia
|
Posted: Tue Apr 19, 2011 5:13 am Post subject: |
|
|
To do matrix multiplication with spreadsheet arrays you need to use the MMULT function, which must be entered as an array function.
=MMULT(A3:B3;C1:C2)=11
=MMULT(C1:C2;A3:B3)={3;4|6;8}
Ken Johnson _________________ If your problem has been solved please add "[Solved]" to the beginning of your first post title (edit button). |
|
| Back to top |
|
 |
|