File Exchange

image thumbnail

hs: a pedestrian history search engine

version (8.29 KB) by us
hs searches the command history for patterns

1 Download

Updated 21 Apr 2009

View Version History

View License

HS searches the command history file for entries containing a specific pattern using the regular expression engine.
the results are displayed in the command window in the format:

#entry location: line

clicking the -location- will open the history file at this line;
clicking the -line- will copy/paste the line to the command prompt and may be return by an [ENTER] command.


>> help hs

for more explanations for this snippet

Cite As

us (2020). hs: a pedestrian history search engine (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (11)

Matt Bauman

Matt Bauman

This is great! Thanks for the submission. One small fix for this to work on Mac:

Change the function GREP_copypaste (line 1168) to

import java.lang.*
import java.awt.*;
import java.awt.event.*;
if ismac
modifier = KeyEvent.VK_META;
modifier = KeyEvent.VK_CONTROL;

Yuri K

Works as expected. Great tool! I believe it should be part of Matlab. Thanks a lot!

Yuri K

I downloaded the file and unzipped it into directory in matlab path. Tried to restart matlab. This error always pops up. I can see grep function nested in hs.m and I can see this line at the end. But I don't have grep.m ('which grep' returns 'not found'.) Looks like I need it but hs documentation does not say it.


yuri, i do not understand this error - GREP is embedded into HS...
if you
type hs
you should see this line at the end (-2 two lines)

%$SSC_INSERT_END 29-Aug-2008/17:29:29 F:/usr/matlab/unix/grep.m

can you give more information...

Yuri K

When clicking on a line I get error:
??? Undefined function or method 'grep' for input arguments of type 'double'. Matlab 2008a.

Kenneth Eaton

John D'Errico

It does what it claims to do, and does so well.

Thierry Dalon

Look great!
I would remove all history entries coming from hs itself. there are not very useful.

Urs (us) Schwarz

dear WS - because at work (a hospital), i'm living behind two(!) firewalls, which wont let me upload anything else than a zip attachment...
sorry for the inconvenience

w s

Why do you put a single m-file in a zip-file? Yet, great tool!

MATLAB Release Compatibility
Created with R2008a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!