Here's how my code start filedir=dir(dirpath)
For k=3:length(filedir) % I start the loop from 3 to avoid the subdir . and ..
fid=fopen(filedir(k).name,'rb','ieee-be') test=fread(fid, 1, 'uint32')
End
Now I know that eventually opening the file inside loop will create memory issue and eventually will crash.. but when I try to open it outside: fid=fopen(filedir.name) it just gives me an error saying too many argument..please help.is there a better way to open outside the loop?
Best Answer