theorangedog.net

MATLAB Diary from aiQUANT

by theorangedog on Nov.03, 2007, under Skills

aiQUANT has an older post that discusses the MATLAB diary. The post also discusses the startup script that aiQUANT uses. For future reference, the post is reprinted below:

Have you ever been frustrated with Matlab when you forget that longwinded command sequence that took ages to get just right and would like to use again, but you didn’t write it down! The Matlab diary helps alleviate this problem. Basically it copies all typed input, and textual output in the command window into a file that you can refer back to at a later date.

To setup the diary such that you get 1 file for each day you use Matlab:

  1. Create a directory in which to store your diary files.
  2. Add the following line to your startup.m file:

 

  1.  

  2. diary(fullfile(pathname‘, date));

Note, one thing to be aware of is that if you accidentally display a large matrix, it will get added to your diary, so the files can get rather large. Here’s an example of what’s in my startup script:

 

  1.  

  2. % Add commonly used paths here

  3. Addpath(d:nameMatlab);

  4.  

  5. % Add commonly used paths here

  6. Addpath(d:myNameMatlab);

  7.  

  8. % Configure the diary to store today’s Matlab session in

  9. diary(fullfile(d:myNameMatlabDiaries‘, date));

  10.  

  11. % This helps alleviate some Matlab bugs to do with plotting coloured surfaces

  12. opengl neverselect;

  13.  

  14. % Change to my current working project directory

  15. cdpathNameHere‘;

:
3 comments for this entry:
  1. foq

    no, but if you’re referring to rod. from Reasonable Deviations, I’m a big fan of his site. I thought this was a great post of yours - I haven’t heard of the the MATLAB diary and wanted to save a reference for future use. hope you don’t mind.

  2. aiQUANT

    Offcourse I dont mind. I’ve added you to my blogroll… so as to share valuable traffic. Cheers!

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Try Google.

Endurance

The best long distance runners eat raw meat, run naked, and sleep in the snow.