I started learning matlab very recently and am stuck on this issue.
My code looks like this:
fileloc = '/no_backup/GroupData/ESRL/Download_18Mar2014/surface/'
list = dir(fileloc, '*.txt')
numTextFiles = length(list)
disp(numTextFiles)
So far I am just checking to see if it has read in the correct amount of text files, but it gives me the error:
"Error using dir
Too many input arguments."
I tried replacing
list = dir(fileloc, '*.txt')
to
list = dir(strcat(fileloc, '*.txt'))
(just in case my syntax was completely wrong since I have no idea)
but then it prints
numTextFiles =
0
0
I am just wondering if any of the functions I'm using are inappropriate and if so, which ones would I use/how would I use those and how would I just display the number of text files I have in that folder?