Hello, I have a question related to importing datafile and reading the model data file then. When I import the data and then run the file for reading the data file, I constantly get such feedback:
if isempty(runDir) || (~isempty(fileDir) && ~strcmp(runDir,pwd))
error(message('MATLAB:run:FileNotFound',scriptname));
end
could you please give me suggestions.

답변 (1개)

Cris LaPierre
Cris LaPierre 2020년 11월 11일
편집: Cris LaPierre 2020년 11월 11일

0 개 추천

I would check that your runDir is valid, and that it is the same as your current folder.
The logic of your condition appears to be
  • error if runDir is empty OR
  • error if (fileDir is not empty AND runDir is not the current folder)

댓글 수: 2

The way I read the code is that you are showing an extract from Mathworks run.m and that your code does something like
run \path\to\filename.m
and that the problem is that the given filename does not exist within the given path.
Cris LaPierre
Cris LaPierre 2020년 11월 12일
I would suggest reading the linked page, Sharing Variables Between Parent and Nested Functions.

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

카테고리

도움말 센터File Exchange에서 Variables에 대해 자세히 알아보기

태그

질문:

2020년 11월 11일

댓글:

2020년 11월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by