From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Matlab Preserves Data in Memory, Even After I run ‘clearvars’
Date: Wed, 5 Dec 2012 14:54:08 +0000 (UTC)
Organization: HSBC
Lines: 9
Message-ID: <k9nn6g$6ub$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1354719248 7115 (5 Dec 2012 14:54:08 GMT)
NNTP-Posting-Date: Wed, 5 Dec 2012 14:54:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2921053
Xref: comp.soft-sys.matlab:784224

So, I run this code:
d = dir('C:\Users\Excel\Desktop\Excel_Files\*.xls*'); 
nfiles = length(d);
for k = 1:nfiles
   eval(['[num' n ', txt' n ', raw' n '] = xlsread(d(k).name,1);']);  

Everything imports fine.  However, if I change some data, and re-run the code, I get what I had initially, NOT the changed data.  So, I run ‘clearvars’, and try again; I get the initial data.  Then, I deleted ALL Excel files in the folder and run the code.  I get 0; this is what I’d expect.  However, if I create a new Excel file, and name it Book1, and put it in that same folder as before, I get what was in the FIRST Book1, not the ACTUAL/NEW Book1.  This makes no sense whatsoever.  It's like Matlab preserves things in it's memory, even after I run 'clearvars'.  It can't be like that.  There’s no practical application for that kind of thing.