cd command and !cd command give different path

조회 수: 4 (최근 30일)
Italo Esposito
Italo Esposito 2020년 5월 8일
답변: Rik 2020년 5월 8일
Hi,
I have a problem on Matlab regarding cd and !cd command.
On Matlab, I choose a working folder which is in the following path:
C:\Temp
Typing cd command, I got:
C:\Temp
while, typing !cd, I got:
C:\Users
Thanks for the support.

답변 (1개)

Rik
Rik 2020년 5월 8일
Those are two different situations
  • cd runs the Matlab function cd and retrieves the current directory that Matlab is using
  • !cd starts a shell from your operating system and runs its cd command (so the Windows command cd in your case)
It isn't really obvious why those two would match. If you create a notepad.m function the results would be drastically different between notepad and !notepad.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by