I am currently developing a basic image processing application on MATLAB. I have to implement undo to previous state feature. I searched net there is uiundo but it only undos GUI actions. Is there a simple command to undo. Thanks.
To recall a deleted entry, right-click and select Undo Delete, or press Ctrl+Z. To delete all entries, click (or in MATLAB Online), and then select Clear Command History from the context menu.
Use the clc command. and select the commands and figures you want to remove. to delete the selected items. Under History Settings, tap Clear All History.
Accepted Answer The only way to go back to a previous iteration is to use a while loop and make the loop counter the appropriate previous value and then "continue".
Octave uses Emacs key bindings by default. In Emacs you would first do Ctrl + G , after which Ctrl + _ (or Ctrl + Shift + - ) would undo.
If you have plenty of memory to spare, you could store all of your program states in a structure and then push this structure into a circular buffer. The number of elements in the buffer would determine the number of levels of undo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With