Saturday, April 18, 2015

Extent Tab-completion inside Matlab Function

Currently Matlab only has tab completion for common functions like "load", "addpath" and others (while GNU Octave can complete inside function). To mimic this tab completion in Matlab function like "wavread" and other function, we can do the following, edit Tc.xml to save our finger for typing complete filename.

  1. Edit Tc.xml by the following command:
  2. edit(fullfile(matlabroot,'toolbox/local/TC.xml'))
  3. Add function (key binding) and  FILE or DIR inside TC.xml
<binding name="wavread"       ctype="FILE"/>
If TC.xml is read only (R2013a), change the permission by using chmod,
sudo chmod a+rwx /usr/local/MATLAB/R2013a/toolbox/local/TC.xml
when your root password when prompted, it is for Unix and Linux-based OS.

It works on Matlab R2009 and 2013a and this tricks save our fingers for repetition and wrong typing.

Matlab Tab-completion

Related Posts Plugin for WordPress, Blogger...