Archive for the ‘software engineering’ Category

C++ Quickguides

Thursday, March 20th, 2008

Python Resources for Scientists, Engineers, and Statisticians

Tuesday, March 18th, 2008

Ordered roughly by relevance for getting to know the kool tool:

Save MATLAB Images with appropriate size

Thursday, November 22nd, 2007

Problem MATLAB figures saved as eps or jpg need to be scaled to put on page, but text gets skewed on scaling, and text size is *always* messed up.

Solution A function that takes figure placement constraints in terms of fraction of page width/height and computes appropriate dimensions of image and saves it.

If the image covers half the page width and quarter of the page height, we can place such 2 figures horizontally, and 4 such figures vertically. To save file with such dimensions in eps format, we call:


    savefigure(gcf, 'figures/coolgraph.eps', 4, 2, 'epsc2');

(more…)

MATLAB Best Practices

Wednesday, November 21st, 2007
  • Figure registration and scale-before-save
  • Choose correct renderer for saving figures. set(gcf, 'Renderer', 'painters'); or figure('Renderer', 'painters') while beginning on a new figure. MATLAB chooses a renderer each time it displays an image (or prints one), balancing memory size with processor load, so a surface plot may be rendered or saved as a bitmap (even in an eps file!). To ensure that MATLAB renders the plot for the best display, set the renderer to ‘painters.’
  • SVN Code repository
  • mlint
  • profile
  • Standard punctuation (and indentation)
  • Non-empty inputs
  • Sensible errors, with mfilename
  • Prior memory allocation for predictable matrices
  • Clearing of unused variables
  • Loops into C++, or Loops into Matrices

MATLAB Session Reports

Thursday, November 15th, 2007

Problem I run a MATLAB session, and test numerous hypotheses. It remains undocumented because there’s no standard for elegant documentation.

Discussion

Features of an organization standard

  • Organization of input
  • Allow modification
  • Inclusion of all graphs
  • Exclusion of selected figures
  • Automation
  • Integration into target documentation, in this case, TeX/LaTeX

(more…)