Continue next statement on cd command

조회 수: 2 (최근 30일)
LEONG SING YEW
LEONG SING YEW 2020년 3월 8일
댓글: John D'Errico 2020년 3월 12일
Hi everyone
Is there a way to continue next line on this cd command? this is to make convenient for me to analyse data
cd 'D:\Onedrive\OneDrive -xxx\bbb\ccc\ddd\3. Simulation\3. Fluent Case\40um - 9\EquivalenceRatio_Osc\0.015\F100';
i tried this but it won't work
cd ['D:\Onedrive\OneDrive -xxx\bbb\ccc\ddd\3. Simulation\3. Fluent Case\40um - 9'...
'\EquivalenceRatio_Osc\0.015\F100'];

채택된 답변

John D'Errico
John D'Errico 2020년 3월 8일
Use cd as a FUNCTION call.
cd(['D:\Onedrive\OneDrive -xxx\bbb\ccc\ddd\3. Simulation\3. Fluent Case\40um - 9'...
'\EquivalenceRatio_Osc\0.015\F100']);
Commands like CD are actually functions, where they can be used in either mode, either as a command or as a function.
  댓글 수: 3
Stephen23
Stephen23 2020년 3월 8일
편집: Stephen23 2020년 3월 8일
John D'Errico
John D'Errico 2020년 3월 12일
Stephen is correct here, in that when you change directories, this forces MATLAB to do some additional work. However, when you just specifiy the directory to look in to read a file, that other work need not be done. As such, MATLAB will be more efficient.
Save those CPU cycles!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by