I made a standalone application to randomly generate string but the app always return the same string
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I made a function that fully works :
function generer_mdp()
liste = ['a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z' ...
'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M' 'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z' ...
'0' '1' '2' '3' '4' '5' '6' '7' '8' '9' '%' '!' '?' '#' '-' '_'];
numChar = input('Combien de charatère ? ');
mdp = randsample(liste, numChar);
disp(mdp)
end
Each time I run the function I got a new string. This what I expected.
Then I export it to a stand alone application but each time I run the app, the string generated is always the same (the number of charater is respected).
I do not know what to do...
2 comentarios
Askic V
el 13 de Abr. de 2023
Just a thought, do you get the same bahavior even if you put
rng shuffle
inside the function?
Respuestas (0)
Ver también
Categorías
Más información sobre MATLAB Compiler en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!