From: Jessica on 18 Jun 2010 23:54 I am trying to get a list of all the .xls files in a folder by using the dir command (I want to get it so that each file can then be called up separately): FileNames=dir('/Volumes/Drive12/'') FileNames(1).name FileNames(2).name FileNames(3).name .. .. .. However, when I try to just get the .xls files, it doesn't work: FileNames=dir('/Volumes/Drive12/','*.xls'). Any suggestions for what is wrong with my code? Thanks!
From: Walter Roberson on 19 Jun 2010 00:00 Jessica wrote: > However, when I try to just get the .xls files, it doesn't work: > > FileNames=dir('/Volumes/Drive12/','*.xls'). > > Any suggestions for what is wrong with my code? You failed to mention the error you get, ??? Error using ==> dir Too many input arguments. That was a clue that you should examine the documentation of dir() and notice that it can only take a single argument. Try dir('/Volumes/Drive12/*.xls')
From: ImageAnalyst on 19 Jun 2010 00:01 With my version of MATLAB, dir() does not take two arguments. Try FileNames = dir('/Volumes/Drive12/*.xls'); or FileNames = dir(fullfile('/Volumes/Drive12/', '*.xls')); which is similar to the example the help shows, and which is the same as FilePattern = fullfile('/Volumes/Drive12/', '*.xls'); FileNames = dir(FilePattern);
From: us on 19 Jun 2010 00:04 "Jessica" <jyorzinski(a)ucdavis.edu> wrote in message <hvhf0s$50$1(a)fred.mathworks.com>... > I am trying to get a list of all the .xls files in a folder by using the dir command (I want to get it so that each file can then be called up separately): > > FileNames=dir('/Volumes/Drive12/'') > FileNames(1).name > FileNames(2).name > FileNames(3).name > . > . > . > > > However, when I try to just get the .xls files, it doesn't work: > > FileNames=dir('/Volumes/Drive12/','*.xls'). > > Any suggestions for what is wrong with my code? > > Thanks! well, yes... what about using the correct syntax, eg, one of the solutions fn=dir('/Volumes/Drive12/*.xls') us
|
Pages: 1 Prev: weird issue with complex signum, see below: Next: Help with coneplot function |