Working with a cell of strings

조회 수: 4 (최근 30일)
L'O.G.
L'O.G. 2022년 12월 3일
답변: Voss 2022년 12월 3일
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