Is there a way to get rid of this warning? I know I can do "dot(expr, expr)" instead, but then I have to type the expression twice.Warning, ^ is ambiguous on non square matrices. Use .^ to apply ^ element by element.
Messages in english
Modérateur : xcasadmin
4 messages • Page 1 sur 1
I often need to "dot product" a vector with itself. E.g., "(pointB - pointA)^2". But when I do this I see the warning:
Given the vector [a,b,c], I want to arrive at a^2 + b^2 + c^2.
[a,b,c]^2 does this (but gives a warning).
[a,b,c].^2 gives [a^2, b^2, c^2]. Not good.
I know I can do "[a,b,c]*[a,b,c]" or "sum([a,b,c].^2)", but I was wondering if there's a shorter syntax.