Import data from GUI into cell
조회 수: 2 (최근 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!