Symbolic matrix element-wise modulus
C = mod(A,B)
C = mod(A,B) for symbolic matrices A and B with integer elements is the positive remainder in the elementwise division of A by B. For matrices with polynomial entries, mod(A, B) is applied to the individual coefficients.
ten = sym('10'); mod(2^ten, ten^3)
ans = 24
syms x mod(x^3 - 2*x + 999, 10)
ans = x^3 + 8*x + 9