Syntax
S = strjoin(C)
S = strjoin(C, separator)
Description
S = strjoin(C) takes an array C and returns a string S which
concatenates array elements with comma. C can be a cell array
of strings, a character array, or a numeric array. If C is a
matrix, it is first flattened to get an array and concateneted.
S = strjoin(C, separator) also specifies separator to be used
for string concatenation. The default separator is comma.
Example
>> str = strjoin({'this','is','a','cell','array'})
str =
this,is,a,cell,array
>> str = strjoin(char({'this','is','a','char','array'}))
str =
this,is,a,char,array
>> str = strjoin([1,2,2],'_')
str =
1_2_2
>> str = strjoin({1,2,2,'string'},'\t')
str =
1 2 2 string
Zitieren als
Kota Yamaguchi (2024). STRJOIN (https://www.mathworks.com/matlabcentral/fileexchange/31862-strjoin), MATLAB Central File Exchange. Abgerufen.
Kompatibilität der MATLAB-Version
Plattform-Kompatibilität
Windows macOS LinuxKategorien
- MATLAB > Language Fundamentals > Data Types > Numeric Types >
- MATLAB > Language Fundamentals > Data Types > Characters and Strings >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
strjoin/
Version | Veröffentlicht | Versionshinweise | |
---|---|---|---|
1.1.0.0 | Added BSD licence statement; Improved efficiency; |
||
1.0.0.0 |