The real() command outputs a complex number (doesn't appear to change it).
3 views (last 30 days)
Show older comments
I want to evaluate the real part of some eigenvalues, but real(eigen) just returns eigen (isreal(real(eigen) returns 0).

2 Comments
Paul
on 21 Jan 2023
Edited: Paul
on 21 Jan 2023
Just because a function is not listed as a function of the symbolic toolbox in its documentation does not mean that function can't be applied to a sym variable. We can further break this situation down into two cases.
First, functions that are not methods of the syms class, but work fine on sym objects because the underlying code in the function all works on sym. The function dot is a good example
x = sym('x',[1 3])
dot(x,x)
Second, some methods of the sym class (at least one, I can't say for sure more than one) are just not documented. For example, exp is a sym method, but is (shockingly, IMO) not listed as a function of the symbolic toolbox on that linked page.
exp(x)
More discussion here
Accepted Answer
More Answers (1)
See Also
Categories
Find more on Assumptions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!