% NAMEFIG Create or focus a figure with a specific name and set its properties.
%
% FIG = NAMEFIG(NAME) creates a new figure with the specified NAME if
% it does not already exist. If a figure with the specified NAME
% exists, it brings the figure to the front.
%
% FIG = NAMEFIG(NAME, 'PropertyName', PropertyValue, ...) sets the
% specified properties of the figure. If 'size' is specified as a
% property name, it sets the size of the figure window.
%
% Example:
% fig1 = namefig('MyFigure', 'size', [400 300]);
% fig2 = namefig('AnotherFigure', 'Color', 'r', 'NumberTitle', 'off');
%
% Inputs:
% NAME - A string specifying the name of the figure.
%
% Optional Property-Value Pairs:
% 'size' - A vector [width height] specifying the size of the figure window.
% Other - Any valid figure property name and its corresponding value.
%
% Outputs:
% FIG - The handle to the created or existing figure.
%
% Notes:
% - If 'size' is specified, it overrides the default size of the figure.
% - Other property-value pairs are applied to the figure using the SET function.
% - If an invalid property name is specified, a warning is displayed.
%
% See also FIGURE, SET, FINDOBJ.
引用格式
宏樹 長嶋 (2024). namefig (https://www.mathworks.com/matlabcentral/fileexchange/168211-namefig), MATLAB Central File Exchange. 检索来源 .
MATLAB 版本兼容性
创建方式
R2024a
兼容任何版本
平台兼容性
Windows macOS Linux标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!版本 | 已发布 | 发行说明 | |
---|---|---|---|
1.0.0 |