Division between scalar and matrix in octave

874 Views Asked by At

I am using octave and when I am writing this:

1/[1;2;3]

It returns the result as this:

ans = 0.071429   0.142857   0.214286

I can't understand this behavior, although I know the difference between '/' and './'.
I know './' refers to element wise division but how is '/' working in this case.

2

There are 2 best solutions below

2
On BEST ANSWER

Since the 'matrix' is not square, the inverse is not defined. In that case, Octave uses the pseudoinverse, which in this case is given by $\frac{1}{14}\begin{pmatrix}1&2&3\end{pmatrix}$.

0
On

$1/[1;2;3]$ solves the system $x \cdot [1;2;3] = 1$ in the least-square sense.