Info

This question is closed. Reopen it to edit or answer.

How to get calculation results when pi is used as a symbolic object?

1 view (last 30 days)
When pi is used as a symbolic object, it seems that we can't get calculation results, for example:
>> syms pi;
>> cos(pi/9)
ans =
cos(pi/9)
But it isn't always that way:
>> syms pi;
>> cos(pi/2)
ans =
0
Now the question is how to get the calculation results after a symbolic expression with pi is created.
Please help me. Thank you!

Answers (1)

Star Strider
Star Strider on 9 Apr 2014
Using vpa or double (link at the end of the vpa page) come quickly to mind.

Community Treasure Hunt

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

Start Hunting!