![matlab drive matlab drive](https://electricalacademia.com/wp-content/uploads/2018/12/storage-devices-1.jpg)
#Matlab drive code#
%// let's get the folder list in a variable (but you can easily hard code it if you preferįolderList = cellstr( ls(baseShareName) ) %// cellstr wrapping call otherwise the output is a char array Then without resorting to external command, you can get a list of the files you are interested in by: baseShareName = '\\CASTOR\SharedFolder\testdata' I've created a directory structure and files according to your example on a shared drive: And you don't even have to change your working directory -) The Matlab function ls can do that for you. If you are only using cd and dir to get a list of file names which you can later open in Matlab, you don't need to use a dos command. Which returns: H:\testdata\c\day1\somedatafile_1.abc
![matlab drive matlab drive](https://blogs.mathworks.com/community/files/runme_ned_2.png)
It should be noted that this functions correctly if I mount the network drive and use that path instead: searchpath = 'H:\testdata\c' Use fopen to generate a valid file identifier. It is possible to change the folder name to remove the space by: Follow the prompt to point MATLAB Drive Connector at the renamed folder. However, these are not valid paths to use with low level I/O: Error using textscan Guillaume is correct, we have no plans to change the default folder name, but you can change it when selecting your MATLAB Drive folder during the setup on all operating systems. This returns a cell array of filenames: Z:\day1\somedatafile_1.abc = system('dir /S /B somedatafile_*.abc') įilelist = regexp(filenames, '(.:\\+\.\w+)', 'match') % Split filenames Oldpath = cd(searchpath) % cd to data directory for simpler dir call My function parses through the user specified folder, c in this case, and looks for all of the data files that match the filter: searchpath = '\\mynetworkshare\testdata\c' With somedatafile_n.abc in each of the day folders. My Google-fu has been defeated.Īs an example, say I have this file structure on \\mynetworkshare \\mynetworkshare\testdata\a
#Matlab drive windows#
while debugging this morning I discovered something strange (to me) and I'm curious to know why Windows (Win7, 64 bit) behaves this way. I have a processing function that I'm using to perform data reduction and our data is stored on a network drive. Apologies in advance for not being able to provide a completely reproducible example, not everyone is going to have a network drive to experiment with.