I have a 1x4 cell array containing strings, that I got using [num,txt]=xlsread(...). Now I would like to add another string, so that it becomes a 1x5 cell array, so that I can use it as column legends for a 5x5 numeric array that I will export with xlswrite. How can I add that string?

 채택된 답변

Thorsten
Thorsten 2015년 10월 28일

1 개 추천

C{1,5} = 'newstring';

추가 답변 (1개)

Jan
Jan 2015년 10월 28일

1 개 추천

C{end + 1} = 'newstring';
Or:
C = cat(2, C, {'newstring'}); % Less efficient

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

질문:

2015년 10월 28일

댓글:

2015년 10월 28일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by