[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
x = Z\z
From: |
oort |
Subject: |
x = Z\z |
Date: |
Thu, 6 Jan 2011 15:08:39 -0800 (PST) |
Hello.
If x = Z\z is the solution of Zx=z and only square systems have solution
then why the operation of non-square matrices Z gives "numerical values"?
Don't you think that it should give some error message?
For instance:
octave:1> A = [3, 2, 6; 2, -2, 1; -1, 0.5, 3]
A =
3.00000 2.00000 6.00000
2.00000 -2.00000 1.00000
-1.00000 0.50000 3.00000
octave:2> a = [1; 2; 3]
a =
1
2
3
octave:3> A\a
ans =
-0.74684
-1.26582
0.96203
OK... "A" is a 3x3 matrice and "a" is a 3x1 matrice
But:
octave:4> B = [3, 2; 2, -2; -1, 0.5]
B =
3.00000 2.00000
2.00000 -2.00000
-1.00000 0.50000
octave:5> b = [1; 2; 3]
b =
1
2
3
octave:6> B\b
ans =
0.29801
-0.11479
Now we have a system of 3 equations and 2 variables. It's a overdefined
system. Curiously B*x does not give equal to "b"...
And if we use a underdefined system we aldo reach a "numeric" result.
octave:7> C = [3, 2, 6; 2, -2, 1]
C =
3 2 6
2 -2 1
octave:8> c = [1; 2]
c =
1
2
octave:9> C\c
ans =
0.42175
-0.51459
0.12732
How it is possible to have a "result" from a underdifined system?
Curiously if we put a third row with zeros in C and if we calculate C*x we
obtain "c". However in octave x = [0.42175; -0.51459; 0.12732] and in MATLAB
x = [0; -0.7857; 0.4286]
--
View this message in context:
http://octave.1599824.n4.nabble.com/x-Z-z-tp3178365p3178365.html
Sent from the Octave - General mailing list archive at Nabble.com.