Execute several m-files one after the other

조회 수: 5 (최근 30일)
Mepe
Mepe 2020년 8월 31일
답변: Walter Roberson 2020년 8월 31일
For an import routine I would like to execute different m-files one after the other. Here at, the file source is then asked:
[path] = uigetdir('C:\Users\gxxxx\Desktop\','Please select folder ...');
if ~ischar(path)
error('Failure!')
return;
end
How can I, on the one hand, control that the various m-files are opened and executed one after the other, and how can I bypass the query shown above when specifying the path and always use the path of the m-file as the source directory?
  댓글 수: 2
Stephen23
Stephen23 2020년 8월 31일
편집: Stephen23 2020년 8월 31일
"...I would like to execute different m-files..."
Are they scripts or functions?
Do they need to be run in the current directory?
Are their names unique, or do other folder/s contain scripts/functions with the same name/s?
Mepe
Mepe 2020년 8월 31일
Hi Stephen,
These are scripts. These are in different locations and should also be executed out there. The names of this files are all different.
Example:
c:\test\01\1.m
c:\test\02\2.m
...
Execution of 1.m when finished 2.m.
Many thanks!

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

답변 (1개)

Walter Roberson
Walter Roberson 2020년 8월 31일
Provide your own uigetdir.m that has the behavior you want. Including possibly having set up ahead of time which directories you want to read from, and having your uigetdir() supply the next directory in sequence each time it is called.

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by