Run scripts with a script

조회 수: 3 (최근 30일)
Aj
Aj 2019년 11월 11일
댓글: Aj 2019년 11월 11일
Hello guys,
I tried to write a scipt (i call it "central"), where i can run other scripts in subfolders.
% "central"
addsubfolders=genpath('C:\Users\Ajith\Desktop\IFP\Varianten');
addpath(addsubfolders)
TPA_V7_1;
TPA_V7_2;
Matlab shows me this warning and stop running:
Warning: Name is nonexistent or not a directory: C:\Users\Desktop\IFP\Varianten\2019-11-08 1 1 XLSX
> In path (line 109)
In addpath (line 86)
In TPA_V7_1 (line 15)
In central (line 4)
My scripts in the subfolders try to open Excelfiles. When i run the script in the subfolders in their location, they run without problems.
When i try to run with "central" to run this scripts, it dont work and addpath doesnt work too.

채택된 답변

Steven Lord
Steven Lord 2019년 11월 11일
genpath is a big hammer. Are you certain you actually need to use it?
Looking at the message you received:
Warning: Name is nonexistent or not a directory: C:\Users\Desktop\IFP\Varianten\2019-11-08 1 1 XLSX
> In path (line 109)
In addpath (line 86)
In TPA_V7_1 (line 15)
In central (line 4)
you've added the path inside central but then you're adding more directories to the path in TPA_V7_1. I'd be concerned that it would be difficult if not impossible for a human to be certain exactly which version of a script or function is being executed inside TPA_V7_1.
But anyway, the path you used in your genpath call in central is:
addsubfolders=genpath('C:\Users\Ajith\Desktop\IFP\Varianten');
In your addpath call inside TPA_V7_1, should there be the word "Ajith" between "Users" and "Desktop"?
  댓글 수: 1
Aj
Aj 2019년 11월 11일
Yes, i added it,but still dont work.
genpath is a hammer, but do you have alternatives?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Search Path에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by