Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!13g2000prl.googlegroups.com!not-for-mail
From: Nathan <ngreco32@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: xlswrite
Date: Fri, 16 Oct 2009 14:00:46 -0700 (PDT)
Organization: http://groups.google.com
Lines: 60
Message-ID: <b353a560-af6d-475e-9914-b800ba12cdc5@13g2000prl.googlegroups.com>
References: <hb6s4f$evt$1@fred.mathworks.com> <hb7104$dus$1@fred.mathworks.com> 
	<7a1ec1d4-02eb-4504-ba86-a10b62b14976@m3g2000pri.googlegroups.com> 
	<hbafk3$il4$1@fred.mathworks.com>
NNTP-Posting-Host: 198.206.219.34
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1255726846 22785 127.0.0.1 (16 Oct 2009 21:00:46 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 16 Oct 2009 21:00:46 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: 13g2000prl.googlegroups.com; posting-host=198.206.219.34; 
	posting-account=_KeVcAoAAAB7j3xn35ujaQ0BoQhuzwJP
User-Agent: G2/1.0
X-HTTP-Via: 1.1 wwwproxy-son-ca-02.ca.sandia.gov:80 (squid/2.5.STABLE14)
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) 
	Gecko/20090824 Firefox/3.5.3,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:577961


On Oct 16, 11:56 am, "Mayur Singh" <mayu...@gmail.com> wrote:
> Hi Nathan,
>
> I'm asuming the following :
> 1. You have no problem in your code if you stored in the variable "m" all the values of n*pi (for n=1 to 50).
>
> 2. You are fine if you wrote all the values of n*pi in the first sheet of an excel file starting from cell "A1"(this assumption is for illustration purposes only and you can play with different options for "woorksheet" and "range" to decide where to write the data in a excel file)
>
> 3.) lets say filename and location is 'C:\test.xls'
>
> filename = 'C:\test.xls';
> m = (1:50)'*pi;
> xlswrite(filename,m,1,'A1');
>
> Nathan <ngrec...@gmail.com> wrote in message <7a1ec1d4-02eb-4504-ba86-a10b62b14...@m3g2000pri.googlegroups.com>...
> > On Oct 16, 9:25?am, "ragab Rabeiy" <r_rab...@yahoo.com> wrote:
> > > > Did you look at the documentation for xlswrite()?
> > > > The worksheet name is one of the optional arguments.
> > > > Just use sprintf() to create whatever name you want, and pass it in.
> > > > Regards,
> > > > ImageAnalyst
>
> > > Hello ImageAnalyst,
>
> > > I don not ask about the worksheet name, please read my message again.
>
> > > The following code gave me 50 files, each one has its iteration value. But I need all the results to be in a unique file (in one exile file). also your code gave me 3 files, and i want only one file.
> > > note the follwing code:
>
> > > folder ='D:\work';
> > > for n=1:50;
> > > ? ? File=sprintf('Test%d.xls',n);
> > > ? ? if~exist(folder,'dir'); mkdir(folder); end
> > > ? ? m=n*pi;
> > > ? ? fileName=fullfile(folder,File);
> > > ? ? xlswrite(fileName,m);
> > > end
>
> > > I hope that it not boring for you.
> > > Ragab
>
> > how about within your loop you specify the cells you want to be
> > written to?
>
> > xlswrite(filename,m,sprintf('A%d',n))
> > %will write output to cell An, where n is your counter
>
>

Just a note: Why were you addressing me?

-Nathan