Least squares example?

How does this work?

julia> r = [1, 2]
2-element Array{Int64,1}:
 1
 2

julia> [1 2; 3 4]
2×2 Array{Int64,2}:
 1  2
 3  4

julia> r \ [1 2; 3 4]
1×2 Array{Float64,2}:
 1.4  2.0

If A is a rectangular m-by-n matrix with m ~= n, and B is a matrix with m rows, then A\B returns a least-squares solution to the system of equations A*x= B, or

If A is a scalar, then A\B is equivalent to A.\B?

I couldn’t figure out if what was stated in ?\ meant the same thing, I don’t think it did. Thanks!

?\ has all the answers.

1 Like