history command buffer in MATLAB - call by command number

后端 未结 1 1581
旧时难觅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)
提交回复
热议问题