Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!a31g2000yqn.googlegroups.com!not-for-mail
From: ImageAnalyst <imageanalyst@mailinator.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: xlswrite
Date: Thu, 15 Oct 2009 07:59:17 -0700 (PDT)
Organization: http://groups.google.com
Lines: 15
Message-ID: <6d40011a-0172-4478-b67c-04c9e03d6aac@a31g2000yqn.googlegroups.com>
References: <hb6s4f$evt$1@fred.mathworks.com> <hb7104$dus$1@fred.mathworks.com> 
	<hb7cbr$a4l$1@fred.mathworks.com>
NNTP-Posting-Host: 192.44.136.113
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: posting.google.com 1255618757 23968 127.0.0.1 (15 Oct 2009 14:59:17 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 15 Oct 2009 14:59:17 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: a31g2000yqn.googlegroups.com; posting-host=192.44.136.113; 
	posting-account=0rLUzAkAAABojYSRC64DkTbtiSCX77HH
User-Agent: G2/1.0
X-HTTP-Via: 1.1 bdci2px (NetCache NetApp/6.0.7)
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 
	CyberSafe-IWA-Enable; .NET CLR 1.1.4322; .NET CLR 2.0.50727; MS-RTC LM 8; 
	.NET CLR 3.0.04506.648; .NET CLR 3.5.21022),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:577561


ragab Rabeiy
Just use sprintf() to create a brand new filename each iteration of
the loop and then write out that uniquely-named file, rather than
overwriting the same file ("test.xls") each time.  For example

baseFileName = sprintf('Test %d.xls', j);
folder = 'c:\my output folder';
if ~exist(folder, 'dir')
    mkdir(folder);
end
fullFileName = fullfile(folder, baseFileName);
xlswrite(fullFileName);

Regards,
ImageAnalyst