Run scripts with a script

1 次查看(过去 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