필터 지우기
필터 지우기

cd funtion

조회 수: 5 (최근 30일)
Suzzie
Suzzie 2011년 4월 6일
when you use cd funtion and the message you get is MCC use of cd funtion is problematic, what do you do?
  댓글 수: 1
Laura Proctor
Laura Proctor 2011년 4월 6일
Could you include the original code and error message?
MCC indicates that you are trying to use MATLAB Compiler. If that's the case, when you use CD, often you will want to use fully qualified path names when using CD.

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

채택된 답변

Laura Proctor
Laura Proctor 2011년 4월 6일
From Loren Shure's Blog on Writing Deployable Code by guest-blogger Peter Webb:
Don't rely on the current directory (cd) or changes to the MATLAB path (addpath) to control the execution of M-files. The path of a deployed application is determined at compiled time, and remains forever fixed. The current directory is never on the path in a deployed application. In the code below, cd-ing to the stringFcns directory does not make stringFcns/add shadow mathFcns/add. The order of these functions at runtime depends on what their order was at compile time. This causes errors.
  댓글 수: 3
Suzzie
Suzzie 2011년 4월 6일
this is the code
Aurelien Queffurust
Aurelien Queffurust 2011년 4월 7일
From your example , avoiding the CD function is easy
dir accepts a directory as input argument:
r = dir(imgdir);
do the same with the save function and destdir folder

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by