Wednesday, December 22, 2010
Tuesday, June 29, 2010
xr = round(x/n) * n
x = original floating point number
n = 10^(-[number of digits after decimal])
e.g. x=1.5673454, n = 0.01 (2 digits after decimal point)
xr = 1.57
Saturday, April 17, 2010
Monday, April 5, 2010
"Could not access the MCR component cache."
This tends to happen because matlab is not able to access the MCE cache directory. By default this happens to be your home directory. When a large number of compiled matlab programs are starting off/running simultaneously (e.g. you submit a job array), the load on the file system is too great giving rise to the problem.
The simplest way to solve this problem, if to point the MCR_CACHE_ROOT environment variable to a local temporary directory on each node on the cluster.
This redirects the cache to a temp directory that is able to handle the traffic.
Saturday, January 9, 2010
A nice trick to visualize high density scatter plots is to bin the data and smooth the 2-D histogram. Then one can use the image function or surf function with alpha transparency to view the joint distribution. Darker regions could represent high density of points and light regions could represent low density of points.
R and several other programming languages have built in functions of this. It is a little surprising that MATLAB doesn't have it built in yet. Anyway, here is a paper that gives a very efficient way of creating these smoothed high-density scatter plots and here is an implementation.