Working with a cell of strings

4 Ansichten (letzte 30 Tage)
L'O.G.
L'O.G. am 3 Dez. 2022
Beantwortet: Voss am 3 Dez. 2022
I have a large N x 1 array of cells, each cell containing a string. How do I convert this to a string array, or to a cell array of character vectors?

Akzeptierte Antwort

Voss
Voss am 3 Dez. 2022
Use string or cellstr.
C = {"one";"two"}
C = 2×1 cell array
{["one"]} {["two"]}
string(C)
ans = 2×1 string array
"one" "two"
cellstr(C)
ans = 2×1 cell array
{'one'} {'two'}

Weitere Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by