how to use mod() with symbolic numbers?

8 ビュー (過去 30 日間)
Paul
Paul 2019 年 5 月 2 日
Is this possible to do in MatLab?
for mod(a,b) == 3, find possible values of a and b
syms a b integer positive
assumeAlso((1 <= a) & (a <= 10));
assumeAlso((1 <= b) & (b <= 10));
e1 = mod(a,b) == 3;
sol = solve([e1], [a, b]);
aSol = sol.a;
bSol = sol.b;
Matlab gives an error..
Error using symengine
Invalid second argument.
Error in sym/privBinaryOp (line 1022)
Csym = mupadmex(op,args{1}.s, args{2}.s, varargin{:});
Error in sym/mod (line 18)
C = privBinaryOp(A, B, 'symobj::zipWithImplicitExpansion', 'symobj::modp');
Error in simple_easter (line 5)
e1 = mod(a,b) == 3;
My actual problem is much more complex, but this is a simple example which demonstrates the error
Thanks

回答 (0 件)

カテゴリ

Help Center および File ExchangeNumber Theory についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by