history command buffer in MATLAB - call by command number

后端 未结 1 1593
旧时难觅i
旧时难觅i 2021-01-13 03:26

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

!10

Anybody knows?

相关标签:
1条回答
  • 2021-01-13 04:19

    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)
    
    0 讨论(0)
提交回复
热议问题