You can save the codes inside the Command Window on an instant basis with the ‘diary’ command in Matlab®. In this article, we will show you how to use the ‘diary’ command and how to call the commands with ‘type’ commands in Matlab®.
You can take notes about your codes inside the Command Window with the diary() command. For example, we typed ‘diary MB’ as shown by the red arrow above and ended this diary note with ‘diary off’ as shown by the second red arrow above.
After running the code, we typed ‘type MB’ which calls the codes between ‘diary MB’ and ‘diary off’. The codes between them have appeared as shown by the red box above in Matlab®.
This method can be very useful to save your codes instantly and call your codes instantly again into the Command Window in Matlab®.
So it is very simple to use the ‘diary’ command in Matlab® as above.
Leave your comments and questions below!
This article is prepared for completely educative and informative purposes. Images used courtesy of Matlab®