How have you tweaked the MATLAB environment to better suit your needs? One tweak per answer.
I run "format compact" to remove all those frustrating blank lines spacing out my output. Oh so simple, but makes it so much nicer to me.
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 = [];
I changed the default font in the MATLAB editor to 10 point ProFont (which can be obtained here) so I could write code for long periods of time without giving myself a headache from straining my eyes.
I run Matlab with the options -nodesktop -nojvm. That way it just sits in a terminal out of the way, and I can use my favourite text editor to my heart's content.
You do miss out of some killer features this way though.
I set the number of lines in the command window scroll buffer to the maximum (25,000). This doesn't seem to noticeably affect performance and allows me to display a large amount of data/results.
I use a startup.m file (sits in the local MATLAB path) to make sure that I have the settings I want whenever I start up MATLAB. This includes such things as formatting the REPL and plot parameters.
I set the Command Window output numeric format to long g.
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.
I invert colors to have a black backgroud, easier on the eyes.
(Alt+Shift+PrintScreen on Windows, you can configure away the huge icons)
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.
I wrote a small function called fig.m to call up figure windows with names rather than numbers and display the name in the status bar.
Funnily enough, there are two or three identically named files that do exactly the same thing on the file exchange.
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.
I set shortcuts for
- open current directory
- up 1 folder
- an action to do 'close all; clear all; clc;'
Ref: http://www.mathworks.com/matlabcentral/fileexchange/19097-custom-panzoom-icons
send the outputs to your email esp when the running is long http://www.mathworks.com/matlabcentral/fileexchange/29183-sending-reports-and-timestamped-file-by-emailing
create a result collector for archiving and sending http://www.mathworks.com/matlabcentral/fileexchange/29255-track-collect-and-tar-inputs-and-outputs
a patch to line up the file within a directory in proper order http://www.mathworks.com/matlabcentral/fileexchange/29033-file-ordering-patch-utility-for-matlab
来源:https://stackoverflow.com/questions/141247/matlab-environment-tweaks