What is the best way to maintain non-MATLAB files (i.e. *.csv or *.exe) in the MATLAB file hierarchy?
4 views (last 30 days)
Show older comments
Commented: Image Analyst on 19 Dec 2018
I'm a fan of placing the file in the appropriate private directory (package or class) to find with 'which' function but am wondering if there is a better way.
I just make a folder for each project and store all the files in there or in subfolders of there. If there are some utilities you use in lots of projects, you can make a Utilities folder and store those m-files in there, and then set a path to that folder so your other project files can see/run them. Not sure if that answers your question or not. Maybe you can clarify what you got - how it's arranged/stored - so we can see what you're doing.
Well, if it's a file used only by that class and no one else, then I'd probably keep it in the folder where the class lives.
Not sure I agree with your colleague. Not that he's wrong, I just believe that's a matter of style.
If you want to keep it in a sub folder of that class called "Data Files" or something like that, then you can.
Either way, I'd use the folder name of the file and use fullfile() to construct the full file name when it comes time to read in that file.
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!