MATLAB Environment Tweaks [closed]

自古美人都是妖i 提交于 2019-12-31 10:38:09

问题


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


回答1:


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.




回答2:


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 = [];



回答3:


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.




回答4:


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.




回答5:


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.




回答6:


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.




回答7:


I set the Command Window output numeric format to long g.




回答8:


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.




回答9:


I invert colors to have a black backgroud, easier on the eyes.

(Alt+Shift+PrintScreen on Windows, you can configure away the huge icons)




回答10:


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.




回答11:


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.




回答12:


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.




回答13:


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




回答14:


  1. 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

  2. create a result collector for archiving and sending http://www.mathworks.com/matlabcentral/fileexchange/29255-track-collect-and-tar-inputs-and-outputs

  3. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!