Is there any shortcut for go back to previous folder?

조회 수: 174 (최근 30일)
wei zhang
wei zhang 2020년 5월 23일
댓글: Walter Roberson 2021년 7월 12일
Sometimes I need to navigate among some folders. I need the "go back" in a convenient way, like "cd -". But, this is not supported in Matlab. Is there any way to achieve this? If not, a keyboard shortcut to pop up the recent directory list is OK,too.
Thank you very much.
  댓글 수: 8
wei zhang
wei zhang 2020년 5월 26일
Embarrassed, I am not familiar with Java script. Navigating among the Java script is hard and frustrating. For me, I prefer to make an own hotkey with Autohotkey for Matlab, by faking a click button on the blue arrow or "file name tab". And wating for updates of Matlab. Thank you for your kindhearted advice. @per isakson (why I can't quote your name)

댓글을 달려면 로그인하십시오.

채택된 답변

Cris LaPierre
Cris LaPierre 2020년 5월 24일
There is a Back button in the Current Folder toolbox. That takes be back to the folder that was previously the current folder. Does that help or are you specifically looking for a keyboard shortcut?
  댓글 수: 2
wei zhang
wei zhang 2020년 5월 25일
Thank you for your advice. I need this. And I am just curious about why Matlab doesn't support "cd - ". It has "cd .././~" yet. Sometimes I was too lazy to move my mouse than keyboard commands, haha.
Walter Roberson
Walter Roberson 2021년 7월 12일
support for . and .. is present because NTFS and all Unix filesystems literally have entries named . and .. inside them. MATLAB does not need to do any special parsing for either one: it can just ask the operating system to change directory (and then query to find out where it ended up.)
There is special processing for ~ as that is not handled by the operating system. It is, however, only necessary to construct the mapping of ~ to a folder name once at startup time using environment variables HOME, or USERDRIVE and USERPATH, as changes to those are ignored (iirc).
Supporting cd - would require that cd keeps history, which it does not do at the moment. I don't think it would be a difficult change to support one level of history, but it would be different in character than what is already implemented.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

soon kiat
soon kiat 2020년 5월 29일
cd ..
can also help to go back to previous folder
  댓글 수: 6
omid zandi
omid zandi 2021년 7월 12일
Does anyone have any suggestion about doing the same thing, but this time for going forward in folders ??
Walter Roberson
Walter Roberson 2021년 7월 12일
cd does not keep any kind of history. It has no idea that you used to be in a folder inside the current folder and want to go back there.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by