FROM STRING TO ARRAY
18 ビュー (過去 30 日間)
古いコメントを表示
how i can to change from string like that :
x = ('ABCDE') ;
to array like:
y = [A,B,C,D,E];
1 件のコメント
Jan
2019 年 6 月 30 日
Please explain, what "[A,B,C,D,E];" means. What is the contents of the variables A, B, C, D, E?
If you really want to access variables dynamically by their names: Don't do thia. TUTORIAL: Why and how to avoid EVAL
回答 (1 件)
Adam Danz
2019 年 6 月 30 日
編集済み: Adam Danz
2019 年 7 月 2 日
From char to cell array of characters
x = 'ABCDE';
y = num2cell(x);
y =
1×5 cell array
{'A'} {'B'} {'C'} {'D'} {'E'}
...to string array of single characters
ys =string(y)
ys =
1×5 string array
"A" "B" "C" "D" "E"
From String to cell array of characters
x = "ABCDE";
y = num2cell(x{:});
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!