How to convert a list in the variable into a cell array
이전 댓글 표시
I have a list of names set as a variable and I would like to know how you can make that list into a cell array without typing each one out
for example my list
val=
ABC
DEF
GHK
can i make/convert that into an array without typing each one out like list={'ABC','DEF','GHK'} thanks
댓글 수: 1
Azzi Abdelmalek
2013년 3월 24일
It should be ABC DEF GHI
답변 (2개)
Azzi Abdelmalek
2013년 3월 24일
편집: Azzi Abdelmalek
2013년 3월 24일
out=cellstr(reshape('A':'I',[],3)')'
댓글 수: 3
Jayden Deng
2013년 3월 24일
Jayden Deng
2013년 3월 24일
Azzi Abdelmalek
2013년 3월 24일
편집: Azzi Abdelmalek
2013년 3월 24일
If there is not any pattern, you have to enter them manually, then use reshape function
Walter Roberson
2013년 3월 25일
0 개 추천
If the variable is currently a char array, then use cellstr() to convert to a cell array.
카테고리
도움말 센터 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!