How to apply a function on a number which is in 'sym' format?
1 回表示 (過去 30 日間)
古いコメントを表示
p = sym('2')^100 - 15;
results = p_inverse(p-1, p);
where the function p_inverse is defined as;
function ia = p_inverse(a, p)
[~,ia] = gcd(a,p);
end
How can I find p_inverse for such p as defined above?
0 件のコメント
採用された回答
Walter Roberson
2022 年 2 月 21 日
p = sym('2')^100 - 15;
results = p_inverse(p-1, p)
mod(results * (p-1),p)
function inv = p_inverse(a, p)
[~, ia] = gcd(a,p);
inv = mod(ia, p);
end
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Special Values についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!