Run scripts with a script

2 ビュー (過去 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 Center および File ExchangeSearch Path についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by