Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

use directory title as title of plot

Asked by Samuel on 19 Jul 2013

hello, i have a test program that i run where the results are stored in specific directories. I wanted to see if there is an easy way to code it so that the title of the plot will just show the directory name.

thanks in advance for the help.

0 Comments

Samuel

Products

No products are associated with this question.

1 Answer

Answer by Image Analyst on 19 Jul 2013

Use set() and set the "Name" property. For example:

set(gcf,'name','c:\Demos by ImageAnalyst\Awesome ones','numbertitle','off')

3 Comments

Image Analyst on 19 Jul 2013

Or for just a plot, not a whole figure, use title

title('c:/some folder', 'FontSize', 15);
Samuel on 19 Jul 2013

Thanks for the reply.

Actually i was hoping for a routine that will automatically get the directory name(i wont have to specify the directory). this is because i was hoping to make one routine that i can copy and paste to the working directory and it will generate th title automatically, instead of me having to modify it for each directory.

Image Analyst on 19 Jul 2013

pwd gets the current folder

title(pwd);
Image Analyst

Contact us