Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

history command buffer in MATLAB - call by command number

Tags:

matlab

Can I call a command from matlab history by its number, pretty much in the same fashion as in unix/linux

!10

Anybody knows?

like image 886
matcheek Avatar asked Dec 10 '10 04:12

matcheek


1 Answers

It is possible to access the command history programmatically using java.

javaHistory=com.mathworks.mlservices.MLCommandHistoryServices.getSessionHistory;

If you want to evaluate the 10-th command in the history, you'd run

eval(javaHistory(10).toString)
like image 194
Jonas Avatar answered Oct 22 '22 10:10

Jonas