Octave のコマンド・メモ (1) | ||||||||||||
|
samba03% octave GNU Octave, version 2.0.17 (sparc-sun-solaris2.8). Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 John W. Eaton. This is free software with ABSOLUTELY NO WARRANTY. For details, type `warranty'. octave:1> a=[1,2;2,3] a = 1 2 2 3 octave:2> x=[1;-1] x = 1 -1 octave:3> b=a*x b = -1 -1 octave:4> a\b ans = 1 -1 octave:5> inv(a) ans = -3 2 2 -1 ctave:6> inv(a)*a ans = 1 0 0 1 octave:7> eig(a) ans = -0.23607 4.23607 octave:8> [p lambda]=eig(a) p = -0.85065 0.52573 0.52573 0.85065 lambda = -0.23607 0.00000 0.00000 4.23607 octave:9> inv(p)*a*p ans = -2.3607e-01 -3.4694e-16 -4.4409e-16 4.2361e+00 octave:10> quit Samba03%
最後の の計算は、丸め誤差の影響で、完全な対角行列にはなっ ていない (が、誤差は のオーダーで十分小さい)。