next line, new line! in the text( ) code
309 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to write text using text code
text(5,5,['MATLAB','\n']);
but '\n' doesn't work.
I want a textbox consisting of three text lines
0 commentaires
Réponse acceptée
Image Analyst
le 9 Nov 2012
Modifié(e) : Image Analyst
le 9 Nov 2012
Try sprintf:
message = sprintf('Line #1\nThe second line.\nAnd finally a third line.');
plot(1:20);
text(5, 5, message, 'FontSize', 20, 'Color', [.6 .2 .6]);
0 commentaires
Plus de réponses (1)
Jan
le 9 Nov 2012
text(5, 5, ['MATLAB', char(10), 'Line 2']);
text(10, 5, {'MATLAB2', 'Line 2'});
1 commentaire
Voir également
Catégories
En savoir plus sur Text Data Preparation dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!