how to cd without printing cd in command window in matlab

You can use diary command to record all the commands executed in a file. After navigating to your desired folder using cd, turn on the diary by typing diary on. Once you are done with your work, turn off the diary by typing diary off. The cd command will not be printed on the command window but it will be saved in the file to which the diary is saved.

Here is an example:

main.m
>> diary mydiary.txt
>> cd C:\Users\myusername\Documents\matlab
>> diary off
77 chars
4 lines

Now the folder path has been changed to the desired location without printing "cd" on the command window.

related categories

gistlibby LogSnag