Search code examples
matlabsetfigure

How to name the docked figure window after using the set command in MATLAB 2019b


After using the set command in matlab 2019b to dock the figures in a separate window:

set(0,'DefaultFigureWindowStyle','docked')

The docked window has the following name:

Figures: Figure 46: Mag Sim - Rotation Period

as can be seen in the following printscreen for my 46th figure:

Print Screen

I would like to change the name of this window from "Figures" to something else so it will look like:

My Defined Name: Figure 46: Mag Sim - Rotation Period


Solution

  • Just use the same command as you would have when creating the window:

    set(gcf,'Name','Window 1')
    

    ´gcf´ is the generic current figure hande aka. get current figure handle. If you want to name it right when creating the figure, use:

    figure('Name','Window 2')