Working with a cell of strings

3 次查看(过去 30 天)
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?

采纳的回答

Voss
Voss 2022-12-3
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'}

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by