x^T P^-1 x.

matrixfrac(x, P)

Arguments

x

input vector.

P

input matrix, needs to be positive semidefinite.