From: Sinisa Jelicic on
clear all
fileList = dir('C:\Users\Laptop\Desktop\Matlab\fileList\kds');
fileList = fileList(~[fileList.isdir]);
[junk, sortorder] = sort([fileList.datenum]);
fileList = fileList(sortorder);
numfiles = numel(fileList);
temp = cell(1,numfiles);
for i1 = 1:numfiles
fid = fopen(fileList(i1).name);
temp{i1} = textscan(fid,'%f%f%s%s%f%f%f%s%s%s\r','Delimiter',';');
fclose(fid);
end;

Hi,
this is my prog for opening files, I need to know how to delete data from memory. Problem is that I always have files originaly used in memory and at new start of prog if I change number of files i get this error

??? Error using ==> textscan
Invalid file identifier. Use fopen to generate a valid file identifier.

and when I look at filelist table i still have old data in there. How to clean old data. Please help I need answer fast.

Thanks
Sinisa