How to add a title to each column/ row in matrix?

조회 수: 2 (최근 30일)
Noah Swiston
Noah Swiston 2015년 4월 6일
답변: Jan 2015년 4월 6일
I have a cell array which displays a word and the number of times it occurs in a file. for example:
'take' [7]
'the' [2]
I would like to add a title to each line so it looks like this
Word: 'take' Count: [7]
Word: 'the' Count: [2]
Any Ideas

답변 (1개)

Jan
Jan 2015년 4월 6일
Where should these titles appear?
Perhaps this helps:
C = {'take', [7]; 'the', [2]};
Ct = C.';
fprintf('Word: %-20s Count: %d\n', Ct{:})

카테고리

Help CenterFile Exchange에서 Title에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by