I figured it out. All i had to do was replace the [] with {}. This changes the strings to cells so it reads the whole string instead part of it.
String array for creating titles for multiple Figures:
16 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
So I have a program that creates 8 figures, and I would like to create an array of strings where titles = ['bla1' 'bla2' ... 'bla8']; and then after each loop i have an index variable that will name that graph appropriately. The problem is it uses the index number for the first string. So the title of the graph in figure 1 is b, and the title of the graph in figure 2 is l and so on. I was wondering if there is anyway I can do something similar to the method I listed where I can do this with an array, or do I have to painfully name each graph individually? (which i would have no idea how to with my current set up.)
Btw i have 3 for loops where:
for a = 1:2
for b = 1:2
for c = 1:2
.
.
(some code for creating points)
.
.
figure;
subplot(2,1,1)
plot(SNR,PD,'-r*')
subplot(2,1,2)
plot(SNR,PFA,'-b*')
title(titles(indexOfTitle));
indexOfTitle = indexOfTitle + 1;
end
end
end
Thanks David
0 commentaires
Réponses (1)
Voir également
Catégories
En savoir plus sur Title 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!