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!