title according to the file name
54 views (last 30 days)
Show older comments
Does anybody know how to (in a plot) put the ‘title’ as the name of the file where the X,Y,Z variables are included? the idea is to generate several and independent plots, based on ‘imagesc’, ‘contolchart’ and other plotting functions. Thanks.
4 Comments
Accepted Answer
Constantino Carlos Reyes-Aldasoro
on 15 Apr 2021
Perhaps you want to add values to the titles of your figures, try something like this
for k=1:9
subplot(3,3,k)
title(strcat('Subplot number =',num2str(k)))
end
If this does not answer your question, we would need more information.
1 Comment
Adam Danz
on 15 Apr 2021
or,
title(['Subplot number = ', num2str(k)])
or,
title(sprintf('Subplot number = %d', k))
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!