MATLAB Environment Tweaks [closed]

2019-03-11 07:12发布

How have you tweaked the MATLAB environment to better suit your needs? One tweak per answer.

14条回答
Evening l夕情丶
2楼-- · 2019-03-11 07:22

I use a function idetitle() that can change the window title of the Matlab GUI itself. Useful in a development environment where I'm running several Matlab processes, possible on different branches of source code or model runs. Sometimes I'll put the PID in the window title to make it easy to find in Process Explorer for monitoring resource usage.

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

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

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

out = [];
查看更多
Emotional °昔
4楼-- · 2019-03-11 07:32

I have functions to 1) save the current figure locations and sizes on the screen, and 2) and one to load such configuration. It's very useful e.g. when monitoring data-heavy simulations.

查看更多
爷的心禁止访问
5楼-- · 2019-03-11 07:34

I implemented analogues of xlim and ylim: xlim_global([xmin xmax]) and ylim_global([ymin ymax]), which sets the axes' limits the same for every subplot in the figure.

查看更多
Emotional °昔
6楼-- · 2019-03-11 07:34

I set shortcuts for

  1. open current directory
  2. up 1 folder
  3. an action to do 'close all; clear all; clc;'

Ref: http://www.mathworks.com/matlabcentral/fileexchange/19097-custom-panzoom-icons

查看更多
欢心
7楼-- · 2019-03-11 07:35

I keep a diary for each session (possibly multiple diary files per day) to recall all commands executed. This is controlled by a startup.m file that checks for previous diary files from that day.

查看更多
登录 后发表回答