Filter löschen
Filter löschen

How does matlab keep track of files not on search path?

6 Ansichten (letzte 30 Tage)
Liyuan
Liyuan am 9 Jan. 2019
Beantwortet: prabhat kumar sharma vor etwa 4 Stunden
I tried to use a class not on the matlab search path and get the following message:
'Session' is not found in the current folder or on the MATLAB path,
but exists in:
/Users/liyuan/Desktop
Change the MATLAB current folder or add its folder to the MATLAB path.
My question is how does matlab keep track of files not on the search path? Does it index all .m files in the system? None of the parent directories Users or Users/liyuan are on my search path either.
  1 Kommentar
Walter Roberson
Walter Roberson am 9 Jan. 2019
Does it index all .m files in the system?
No, definitely not. It would take well over half an hour if it tried to do that on my system, as I have over 15 terabytes of external drives. It would take about two days on my system if it accidentally tried to find the files inside one of my Time Machine backups.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

prabhat kumar sharma
prabhat kumar sharma vor etwa 4 Stunden
Hi Liyuan,
MATLAB does not index all .m files on your system due to the potential time and resource constraints. Instead, it relies on the current folder, the search path, and recent folder checks to locate files. For consistent access, it’s best to add frequently used folders to the MATLAB search path.
You can refer below documentation for your refrence:
you can add the folder containing your file to the MATLAB search path using the addpath function:
addpath('/Users/liyuan/Desktop');
Or use the pathtool to interactively add the folder:
pathtool;
I hope it helps!

Kategorien

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

Community Treasure Hunt

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

Start Hunting!

Translated by