HxSearch

버전 1.2 (10.9 KB) 작성자: Adam Danz
Search command history within and across Matlab sessions
다운로드 수: 885
업데이트 날짜: 2015/4/18

라이선스 보기

HxSearch.m allows user to search entire command history for key word(s) or phrase(s) and outputs full command lines containing the search item.
[SearchResults, NumCommandsAgo] = HxSearch (txtstr, specificity, max_output, session)
R = HxSearch ('save') >>> this will return a list of command history lines containing the word "save".
R = HxSearch ('save', 1) >>> this will return a list of command history lines beginning with the word "save".
R = HxSearch ('save', '', 50) >>> this will return up to 50 results (default is 20)
R = HxSearch ('save', '', '', 1) >>> this will only search your current session history
[R, N] = HxSearch ('save') >>> this also provides a vector of integers showing number of commands since R
Examples in use:
1) Display most recent 'load' command
[SearchRes, NumAgo] = HxSearch('load', 1, 1);
disp([SearchRes, ' was loaded ', num2str(NumAgo), ' commands ago.'])

2) re-load most recent file loaded
eval(HxSearch('load', 1,1));

3) see help HxSearch for more examples and information

In brief, Matlab versions earlier than R2014a save command history differently than current versions. This script works with both methods. See help HxSearch for more info.

My matlab vs is R2014a so please contact me if there are any bugs on other versions.

인용 양식

Adam Danz (2024). HxSearch (https://www.mathworks.com/matlabcentral/fileexchange/50551-hxsearch), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2014a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.2

Matlab versions earlier than R2014a will search history.m while newer versions will search history.xlm.

1.1.0.0

An example was wrong in the comments section.

1.0.0.0