How to horizontally merge cells of strings/chars for each row without writing a for-loop?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have some m*n cells of char arrays, and the figure serves as an example for that. Is it possible to horizontally merge char arrays of each rows like 'B659' and 'Z01' to 'B659Z01' without using a for-loop to iterate each row?
댓글 수: 0
채택된 답변
Walter Roberson
2022년 11월 21일
fmt = repmat('%s', 1, size(YourCell,2));
output = compose(fmt, string(YourCell));
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!