Random String Utility

バージョン 1.0.0.0 (1.68 KB) 作成者: Dan Couture
Generate a random string. Specify length and type of characters.
ダウンロード: 344
更新 2012/8/20

ライセンスの表示

編集メモ: This file was selected as MATLAB Central Pick of the Week

RANDOM_STRING - Generate a random string

When a name is needed but none is provided, never fear
RANDOM_STRING is here! As configured returns a random
set of upper case letters (default of 10 long)

Input:
@length
value - Length of the random string to generate
default - 10
type - int
@type
value - Type of characters to include.
1 = A-Z, 2 = a-z, 3=letters/#'s/special chars
default - 1
type - int

Return:
@str
value - The generated random string
type - str

Usage:
my_str = random_string(); % 10 upper case letters
my_str = random_string(15); % 5 upper case letters
my_str = random_string(8, 3); % 8 ascii characters

引用

Dan Couture (2026). Random String Utility (https://jp.mathworks.com/matlabcentral/fileexchange/37853-random-string-utility), MATLAB Central File Exchange. 取得日: .

MATLAB リリースの互換性
作成: R2007a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersCharacters and Strings についてさらに検索
バージョン 公開済み リリース ノート
1.0.0.0