How to assign values to variables in sym function in matlab while finding out modulus?

2 views (last 30 days)
While finding out modulus while dealing with very large numbers, i used the sym tool.
Usage of sym tool E.g:
a=5; b=2;
c=sym('a^b');
mod(c,10)
ans= a^b mod 10
The answer should be clearly 5,but it does not pass values to the variables.
The sym tool is very necessary when the inputs are very high i.e a,b,c > 500.

Accepted Answer

Walter Roberson
Walter Roberson on 18 Mar 2014
c = subs(sym('a^b'));

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!