Try coding directly against Java AWT classes. It can be more flexible and work inside the Matlab engine running under C ++. (I have not tested it in this context, since I do not use the engine.)
function change_win_title(oldName, newName) wins = java.awt.Window.getOwnerlessWindows(); for i = 1:numel(wins) if isequal(char(wins(i).getTitle()), oldName) wins(i).setTitle(newName); end end
You would use it like that.
change_win_title('MATLAB Command Window', 'My new window name')
You can use other tests (window class, etc.) to identify windows of interest.
source share