Run scripts with a script

1 visualización (últimos 30 días)
Aj
Aj el 11 de Nov. de 2019
Comentada: Aj el 11 de Nov. de 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.

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Search Path en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by