Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I search through MATLAB command history?

Tags:

I would like to search for a specific command I've previously used. Is it possible to do a free text search on MATLAB command history?

like image 470
snakile Avatar asked Feb 19 '11 21:02

snakile


1 Answers

Yes. Matlab stores your command history in a file called history.m in the "preferences folder," a directory containing preferences, history, and layout files. You can find the preferences folder using the prefdir command:

>> prefdir  ans =  /home/tobin/.matlab/R2010a 

Then search the history.m file in that directory using the mechanism of your choice. For instance, using grep on unix:

>> chdir(prefdir) >> !grep plot history.m plot(f, abs(tf)) doc biplot !grep plot history.m 

You can also simply use the search function in the command history window if you just want to use the GUI.

like image 103
nibot Avatar answered Oct 25 '22 09:10

nibot