首先输入矩阵,例如:
octave:1> a=[3,4;2,16]
a =
3 4
2 16
然后,利用pinv函数求逆
octave:2> pinv(a)
ans =
0.400000 -0.100000
-0.050000 0.075000
octave:3> pinv(a)*a
ans =
1.00000 -0.00000
0.00000 1.00000
首先输入矩阵,例如:
octave:1> a=[3,4;2,16]
a =
3 4
2 16
然后,利用pinv函数求逆
octave:2> pinv(a)
ans =
0.400000 -0.100000
-0.050000 0.075000
octave:3> pinv(a)*a
ans =
1.00000 -0.00000
0.00000 1.00000