Friday, April 12, 2013

Change the format for displaying numbers in Matlab's workspace

By default, Matlab shows in its workspace and at the command line numbers in a format that may not be suitable in all cases, e.g., when you have a large number of decimal digits.
The format of the number display can be changed by the built-in command

format Style

where Style indicates different formats.
See the Help page of the format built-in command for its syntax and the list of possible formats.

Import data into Matlab from an ASCII text file

A quick intro about the different built-in functions available in Matlab for importing data from an ASCII text file can be found at

http://www.mathworks.ch/ch/help/matlab/import_export/ways-to-import-text-files.html

The importdata function is particularly useful.

Wednesday, February 27, 2013

Running multiple instances of ImageJ

Multiple instances of ImageJ cannot be run, by default.
Try to double click on the ImageJ icon multiple times, after an instance of it is already opened, and the control will return to the already open instance.
To start multiple instances of ImageJ you need to
  1. change a default option that allows to run a single instance listener only; you can do that under Edit -> Options -> Misc ..., where you can uncheck the box close to Run single instance listener;
  2. start ImageJ by the command line with the option --allow-multiple, e.g., $ ImageJ-linux64 --allow-multiple

Sunday, June 24, 2012

Publication-ready EPS figures by Matlab

Matlab sucks when it comes to export figures in the EPS format: no bounding box, low quality, ...
Unless you use one of these two tools:

export_fig

EPS Utility Toolbox

Both of them are available on Matlab Central.

Wednesday, December 14, 2011

Gaussian univariate functions: two useful features

Two interesting/useful features of Gaussian functions of a single variable:

  • the product of two Gaussian functions is still a Gaussian function
  • the convolution product of two Gaussian functions is still a Gaussian function with mean equal to the sum of the means and variance equal to the sum of the variances.
Proof of both properties .... still to come ... it's not so immediate ... but it's not too difficult !

Monday, November 14, 2011

Bash printf command

The printf command is very useful for formatting expressions in Bash.

printf -v VAR <format> <expression>

See more information at the URL http://wiki.bash-hackers.org/commands/builtin/printf.

Friday, October 28, 2011

Matlab's graphical data tip precision

The graphical data tip in Matlab allows you to visualize the values of a point in a plot.
It comes with a certain decimal precision level already set as default (4 decimal digits).
You can change the default number of decimal digits.
See at the following Webpage,

http://www.cs.washington.edu/homes/dhalperi/useful.html

(thanks to Daniel Halperin for the suggestion).

2017 update

The previous instructions are valid for Matlab R2014a and older versions.
For Matlab R2014b and newer version, follow the suggestions from the following threads:

https://stackoverflow.com/questions/25477401/matlab-permanently-set-text-update-function-for-data-cursor-in-figures/39330765#39330765

Thanks to Michael Hirsch for pointing this out.