I'm trying to divide matrix by its last row (each column by its last element - aka Homogeneous coordinates) and then return submatrix containing everything except that last row. Something like this in Matlab:
normx = bsxfun(@rdivide,A,A(end,:));
output = normx(1:end-1,:);
Since I'm new to F# I'm not quite sure about anything, but I tried this:
let hnorm(A:Matrix<double>) =
let partialResult = A |> Matrix.iterCols (fun col -> col/col.[col.Count-1])
partialResult.Rows(0,3)
but I got the "This expression was expected to have type 'unit' but here has type 'Vector< double >'" error in the lambda expression.
And I don't understand what is wrong since examples like
let result = [2;4;6] |> List.map (fun x -> x * x * x)
work well.
Could someone please explain how this can be done because I think I'm missing some basics or misunderstood them.
Thanks!