Import data from GUI into cell
1 回表示 (過去 30 日間)
古いコメントを表示
How to import data from GUI edit text into cell?
Example: 'a b c' in GUI, in workspace each character created in individual cell.
TQ
0 件のコメント
回答 (1 件)
Martijn
2011 年 2 月 9 日
Suppose you have:
A = 'a b c';
Possibly obtained by:
A = get(handles.myTextEdit,'String');
Then to get each character (including spaces) separately, you can use:
>> B = num2cell(A)
B =
'a' ' ' 'b' ' ' 'c'
Or if you want to only get the actual letters, i.e. split on the space character, you could use REGEXP:
>> C = regexp(A,' ','split')
C =
'a' 'b' 'c'
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Cell Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!