Tuesday, October 4, 2011

startup.m (2)

A long time ago I wrote about setting defaults in startup.m.

Today I finally got to running my new MATLAB on my new computer and have been doing things like setting the path and specifying startup.m.

It is probably safer not to rely too much on startup.m, because if you write a program and then send it to someone else, who hasn't set default font and linewidth and etc. like your own startup.m, then things can get ugly.

I set two things in my startup.m (which is placed into a folder near the top of my path)

(1) MATLAB will open up to a specific folder:
cd C:\Users\me\Documents\MATLAB

(2) log everything I type into the commandline into a date-specific text file

diaryname = ['diary\' datestr(now, 'yyyy-mm-dd') '-diary.txt'];
diary(diaryname);


I'm pretty pleased about these two things. 



No comments:

Post a Comment