Filter löschen
Filter löschen

Run scripts with a script

1 Ansicht (letzte 30 Tage)
Aj
Aj am 11 Nov. 2019
Kommentiert: Aj am 11 Nov. 2019
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.

Akzeptierte Antwort

Steven Lord
Steven Lord am 11 Nov. 2019
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 Kommentar
Aj
Aj am 11 Nov. 2019
Yes, i added it,but still dont work.
genpath is a hammer, but do you have alternatives?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Search Path finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by