【问题标题】:Dynamically changing the command window title in Matlab在 Matlab 中动态更改命令窗口标题
【发布时间】:2013-07-04 09:10:29
【问题描述】:

我想在 matlab 中更改命令窗口的标题以说明我正在处理的当前分支。 我知道在哪里可以找到当前的分支名称。 我需要每次更改此文件以记录新分支时,命令窗口的标题都将使用新的分支名称进行更新。

有什么想法吗?

【问题讨论】:

  • 这个问题的答案 -- stackoverflow.com/questions/1924286/… -- 可能会有所帮助。
  • 嗨,我需要动态更改它,而不仅仅是第一次。我需要跟踪更改的文件并更新命令窗口。

标签: windows matlab matlab-deployment


【解决方案1】:

我有这个 M 文件(我想我是从 here 得到的)。它可能适合您的需求:

function idetitle(Title)
%IDETITLE Set Window title of the Matlab IDE
%
% Examples:
% idetitle('Matlab - Foo model')
% idetitle(sprintf('Matlab - some big model - #%d', feature('getpid')))

    win = appwin();
    if ~isempty(win)
        win.setTitle(Title);
    end
end

function out = appwin()
    %APPWIN Get main application window

    wins = java.awt.Window.getOwnerlessWindows();
    for ii = 1:numel(wins)
        if isa(wins(ii), 'com.mathworks.mde.desk.MLMainFrame')
            out = wins(ii);
            return
        end
    end

    out = [];

end

【讨论】:

  • 您好,但是如何跟踪特定文件并更改窗口标题?
猜你喜欢
  • 1970-01-01
  • 2013-04-12
  • 1970-01-01
  • 1970-01-01
  • 2010-09-07
  • 1970-01-01
  • 1970-01-01
  • 2011-06-08
  • 1970-01-01
相关资源
最近更新 更多