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 (최근 30일)
이전 댓글 표시
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
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Title에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!