I made a standalone application to randomly generate string but the app always return the same string

2 ビュー (過去 30 日間)
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 件のコメント
Askic V
Askic V 2023 年 4 月 13 日
Just a thought, do you get the same bahavior even if you put
rng shuffle
inside the function?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by