Rational power of a positive definite matrix

3 views (last 30 days)
q = sym([4 2 ; 2 4]);
f = sqrtm(q)^(-1) - sqrtm(q^(-1));
f should be zero here since q is positive definite.
However, the program yielded a non zero f here. Is this due to the calculation error ? Note that I am using symbolic calculation here so there should be no error at all I assume.

Accepted Answer

John D'Errico
John D'Errico on 13 Feb 2017
Edited: John D'Errico on 13 Feb 2017
Sometimes the answer is just "simple".
ans =
[ 0, 0]
[ 0, 0]
Symbolic results are not always returned in the most simple possible form.
  1 Comment
Qian Feng
Qian Feng on 13 Feb 2017
Thanks for the suggestion. I should have realized that.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by