Weird output and calling to another function
Afficher commentaires plus anciens
I'm having weird issues with a weird output of ans = 1 from this code
function m = primefactors(m)
k=zeros(1,m);
x = 2;
while m>1
if mod (m,x) == 0
m=m/x;
k(end+1)=x;
else
x=x+1;
end
end
z=k(k~=0);
disp(z)
end
I'm then also trying to store those outputs into another function but i'm not sure how
function g = RSA(n,e)
[p,q] = primefactors(n);
disp(p)
disp(q)
end
4 commentaires
darova
le 14 Avr 2020
What is this?

Les Beckham
le 15 Avr 2020
darova
It appears to be a tiny, tiny image that is impossible to read unless I zoom the entire web page to around 500%. :) Can you make it bigger?
James Tursa
le 15 Avr 2020
What do you mean by "storing p and q into another function"? Can you elaborate?
darova
le 15 Avr 2020
Les Beckham, user right button mouse:

Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Platform and License dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!