Using dynamic subscripts in plot title
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Earl
am 15 Apr. 2012
Bearbeitet: Carlos A. Morales Rergis
am 18 Feb. 2014
I want to use subscripts in a plot title, but the value I want to use changes, depending on the subplot. E.g. If I have 3 subplots (varies) then I want the first plot's title to look like:
title('x_1')
and the second to be:
title('x_2')
etc. I have the value for the subscript in a variable, say i, but how do I set this as a subscript? If I try:
title('x_i')
MatLab interprets the 'i' literally of course. What is the correct way?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 15 Apr. 2012
title(sprintf('x_%d', i))
2 Kommentare
Carlos A. Morales Rergis
am 18 Feb. 2014
Bearbeitet: Carlos A. Morales Rergis
am 18 Feb. 2014
Hello, I have a question:
What happens when i > 9?
How to insert subscript two or three symbols?
e.g:
title(' x_1_2 ')
Thank you a lot!
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Title finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!