how to change from one directory to another
Ältere Kommentare anzeigen
Hello, I have two folders in a parent folder. One folder contains jpg images while the other contains mat files. I then create 3 separate folders within which I want to process the data in the two original folders and store them in the 3 created folders using for loops for each of the 3 folders. After processing and storing data in the first folder, how can I come out of that folder and access the second folder to process and store data before going out of it and accessing the third folder and doing the same. Thanks for any assistance.
1 Kommentar
Stephen23
am 3 Dez. 2015
Rather than changing directories, you should pass a path argument to your functions. This is much more reliable and robust, as the link in Image Analyst's Answer's explains.
Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 3 Dez. 2015
1 Stimme
If you want an easier time than the above method you accepted, use genpath(). See may attached demo which goes into every subfolder getting filenames.
And read the FAQ discussion/warning about using cd: http://matlab.wikia.com/wiki/FAQ#Where_did_my_file_go.3F_The_risks_of_using_the_cd_function.
Kategorien
Mehr zu Search Path finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!