creating a cell with serial names
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
I want to create a list (1x15 cell) of 15 names (sometimes more than that) with names of following pattern;
AB_01, AB_02, AB_03,....AB_15.
Is there an easy way to do this , in a loop like, rather than type it each.
Thanks
댓글 수: 0
채택된 답변
Akira Agata
2019년 6월 18일
How about the following?
suffix = repmat({'AB_'},15,1);
number = cellstr(num2str((1:15)','%02d'));
output = strcat(suffix,number)';
댓글 수: 3
Stephen23
2019년 6월 20일
darshani Thotagamuwage's incorrectly accepted "Answer" moved here:
It worked very well. Thanks a lot
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!