Thursday, June 3, 2010

Matlab: repcell

There is a repmat function in Matlab, why isn't there a repcell function?

Oh well, this is practically repcell:
num2cell(repmat(value,dim1,dim2));

Tuesday, June 1, 2010

Screens on angsana

Despite several short downtimes of the Matlab license server on Angsana, the access nodes themselves are almost always up. Starting a screen session with multiple windows has been an excellent way to stop/resume work on my Matlab codes. Unfortunately, I don't always get logged in to the same access node.

Fortunately, adding the following code to my bash_profile solved the problem:
if [ "`hostname`" != "???.cl.comp.nus.edu.sg" ]; then
ssh ???
fi


Just replace ??? with the access node of choice.