MATLAB data cursor–higher precision (more digits displayed)

MATLAB data cursor by default gives you 4 digits of precision. You can increase the precision of MATLAB’s data cursor (displaying more digits) by altering the “default_getDatatipText.m”.

Look inside “default_getDatatipText.m” for this:
function [str] = local_Geometry_getDatatipText(hgObject,hDataCursor)
% Determine datatip string that appears for a patch, surface, or line

DEFAULT_DIGITS = 4; % Display 4 digits of x,y position

Now change DEFAULT_DIGITS to your liking.

Here’s how to find “default_getDatatipText.m”:
it’s in directory: <MATLAB_dir>/toolbox/matlab/graphics/@graphics/@datacursor

What is <MATLAB_dir>?  Depends on your particular install and operating system.

Linux: might be /usr/local/MATLAB.   To find it, type at the Terminal: whereis matlab

Windows: might be c:\program files\matlab  or c:\program files (x86)\matlab

 

Example: for MATLAB 2012a Student on Linux, the relevant directory is:

/usr/local/MATLAB/R2012a_Student/toolbox/matlab/graphics/@graphics/@datacursor

 

RESTART MATLAB after making this change!

Converting RIS citations to Bibtex / Biblatex citations

the handy utilities at:

http://sourceforge.net/p/bibutils/home/Bibutils/

will convert RIS to Bibtex (Biblatex) format. You must compile from the source code (no problem).

Here’s how:

  1. Download most recent copy from: http://sourceforge.net/projects/bibutils/files/
  2. Extract to /tmp directory
  3. type cd /tmp/bibutils*
  4. type ./configure && make && sudo make install

Now, to convert from RIS to BIBTEX, imagine i have cit02.ris, type:
ris2xml cit02.ris | xml2bib > cit02.bib

GIMP Greek characters Ubuntu

Here’s how to enter Greek characters in GIMP (or likely many other Ubuntu/Linux programs)

See the chart at: http://en.wikipedia.org/wiki/Greek_alphabet#Greek_in_Unicode
the row labels e.g. 03bx are the first 3 characters you type after the ctrl+shift you will see below. The last “x” value is the column of the table

To enter the characters, first press and the letter “u” at the same time, then release all three keys and type the four-digit code and press Enter.

Examples:
“mu” μ, type

 <ctrl><shift>u 03bc <enter>

“gamma” ϒ, type

 <ctrl><shift>u 03d2 <enter>

Cropping AVI files in FFMPEG

The syntax to crop AVI files in FFMPEG has changed recently from the previous syntax. The syntax for FFMPEG version 0.7.3 AVI cropping is as follows:

ffmpeg -i input.avi -vf crop=439:455:73:15 -vcodec mjpeg -qscale 2 output.avi

The assumptions made above were that you wanted your output video to be:
439 pixels wide
455 pixels high
trimming 73 pixels from the left
trimming 15 pixels from the top
of your input video, and that you wanted Motion JPEG output e.g. “-vcodec mjpeg“.
The “-qscale 1” makes low compression (best possible MJPEG quality). qscale can go from 1 to 31 in the current version of ffmpeg.

Obviously, change these pixel parameters to suit your particular video.

Matlab R2012a Linux Computer Vision Toolbox bug

The vision.VideoFileReader method will issue a “Could not open the specified file” error if you use the ~ in the filename for your home directory. The ~ notation works for every other Matlab command but vision.VideoFileReader

e.g. non-working code
filename = '~/myVideos/foo.avi';
hvfr = vision.VideoFileReader(filename, 'ImageColorSpace', 'Intensity');
step(hvfr)

>>Error using VideoFileReader/step
Could not open the specified file.

but if you type:
filename = '/home/mypc/myVideos/foo.avi';

(where mypc is your login name)
then vision.VideoFileReader works normally.

I have filed a bug report with The Mathworks.

LabVIEW 2011 64-bit (on Windows 7 x64) installation

LabVIEW 2011 has only a few toolkits that work as a 64-bit installation on 64-bit Windows 7. You can see the list of the supported LabVIEW 64-bit toolkits at:

http://zone.ni.com/devzone/cda/tut/p/id/10383

With regard to Device Drivers, the same Device Drivers DVD or download (4.8GB) is used for 32-bit and 64-bit LabVIEW. When you start the Device Driver installation, you will be prompted for each available items whether you want 32-bit or 64-bit.

National Instruments notes that you can install both 32-bit and 64-bit LabVIEW on a Windows 7 x64 system, and virtually all toolkits are said to work for a 32-bit LabVIEW install on a Windows 7 x64 (64-bit) system. There is said to a bit a of a performance penalty for using 32-bit LabVIEW on 64-bit Windows 7, due the Windows on Windows (WoW) emulation layer, but I haven’t yet found any benchmarks supporting what the difference is. Perhaps something I’ll post on in the future.

LabVIEW 2011 Device Drivers installation (unzipping) issues

The built-in ZIP-file decompression of Windows 7 x64 does not seem to be able to handle the 4.8GB download of the LabVIEW 2011 Device Drivers–the ZIP decompression crashes after several minutes.

I have found that the free, open-source (FOSS) 7-Zip program handles such large (>2.1GB) ZIP files easily, unzipping this large 4.8GB file in about 3 minutes.

www.7-zip.org

MATLAB Linux AVI playback “only uncompressed AVI movies can be read on UNIX” error

MATLAB on Linux claims to only playback uncompressed AVI files on “UNIX” systems.

However, MATLAB on Linux can’t even play all uncompressed AVI filed depending on your particular system configuration with gstreamer. The solution thus far, with MATLAB 2012a, seems to be using Motion JPEG in AVI videos.

Here’s a tentative solution for playing back video on Linux systems with MATLAB 2012a, that is, MATLAB “should” be able to playback “out.avi”

ffmpeg -i input.avi -vcodec mjpeg -qscale 1 out.avi

If you get an error about not having ffmpeg installed, on Ubuntu type in Terminal:

sudo apt-get install ffmpeg

Here is a video I transcoded the first second of using the above settings

Star collapse video from http://people.sc.fsu.edu/~jburkardt/data/avi/avi.html

(here is the actual command I used to truncate the video to one second and to heavily compress to reduce download size)
ffmpeg -i input.avi -vcodec mjpeg -t 1 -qscale 11 out.avi
(The sample AVI file is used under GNU LGPL from http://people.sc.fsu.edu/~jburkardt/data/avi/avi.html )

MATLAB R2012a (student version) in Ubuntu 11.10 (64-bit)

The student version (32-bit) of MATLAB R2012a under Ubuntu 11.10 64-bit seems to work just fine.

With R2011a student version, I had issues with the Symbolic Toolbox not working, i.e. using 100% CPU and needing to use “xkill” to stop MATLAB.

No such issues with R2012a student version, thankfully.
Provided that you chose to install with symbolic links (e.g. in usr/local/bin), you can start MATLAB by typing

matlab -glnx86 -desktop

in the Terminal, or just make a shortcut.