Effacer les filtres
Effacer les filtres

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

2 vues (au cours des 30 derniers jours)
Noah Swiston
Noah Swiston le 6 Avr 2015
Réponse apportée : Jan le 6 Avr 2015
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

Réponses (1)

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

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by