<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263199</link>
    <title>MATLAB Central Newsreader - xlswrite</title>
    <description>Feed for thread: xlswrite</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 15 Oct 2009 10:05:03 -0400</pubDate>
      <title>xlswrite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263199#687195</link>
      <author>ragab Rabeiy</author>
      <description>i am a new user in Matlab, and i faced small problem, could u please help me??&lt;br&gt;
&lt;br&gt;
this problem is: for the following code, Matlab writes only in Excel the final value (pi*5),&lt;br&gt;
&lt;br&gt;
and I want it to write all the data from 1 to 5.&lt;br&gt;
&lt;br&gt;
for x=1:5;&lt;br&gt;
m=pi*x;&lt;br&gt;
xlswrite('file.xls', m)&lt;br&gt;
end</description>
    </item>
    <item>
      <pubDate>Thu, 15 Oct 2009 11:28:04 -0400</pubDate>
      <title>Re: xlswrite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263199#687221</link>
      <author>Branko </author>
      <description>&quot;ragab Rabeiy&quot; &amp;lt;r_rabeiy@yahoo.com&amp;gt; wrote in message &amp;lt;hb6s4f$evt$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; i am a new user in Matlab, and i faced small problem, could u please help me??&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; this problem is: for the following code, Matlab writes only in Excel the final value (pi*5),&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; and I want it to write all the data from 1 to 5.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; for x=1:5;&lt;br&gt;
&amp;gt; m=pi*x;&lt;br&gt;
&amp;gt; xlswrite('file.xls', m)&lt;br&gt;
&amp;gt; end&lt;br&gt;
&lt;br&gt;
Why do you use for loop? No need in this case:&lt;br&gt;
x=1:5;&lt;br&gt;
m=pi*x;&lt;br&gt;
xlswrite('filename.xls', m)&lt;br&gt;
&lt;br&gt;
Branko</description>
    </item>
    <item>
      <pubDate>Thu, 15 Oct 2009 12:46:04 -0400</pubDate>
      <title>Re: xlswrite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263199#687236</link>
      <author>Nasser Abbasi</author>
      <description>&lt;br&gt;
&quot;ragab Rabeiy&quot; &amp;lt;r_rabeiy@yahoo.com&amp;gt; wrote in message &lt;br&gt;
news:hb6s4f$evt$1@fred.mathworks.com...&lt;br&gt;
&amp;gt;i am a new user in Matlab, and i faced small problem, could u please help &lt;br&gt;
&amp;gt;me??&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; this problem is: for the following code, Matlab writes only in Excel the &lt;br&gt;
&amp;gt; final value (pi*5),&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; and I want it to write all the data from 1 to 5.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; for x=1:5;&lt;br&gt;
&amp;gt; m=pi*x;&lt;br&gt;
&amp;gt; xlswrite('file.xls', m)&lt;br&gt;
&amp;gt; end&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
becuase each time in the loop, you are starting all over and writing to a &lt;br&gt;
new file.xls. The old file.xls is overwritten. there is no append by &lt;br&gt;
default.&lt;br&gt;
&lt;br&gt;
As mentiod, no loop is neede, write the whole matrix data in one write. see &lt;br&gt;
help on how to make different sheets if you want.&lt;br&gt;
&lt;br&gt;
--Nasser </description>
    </item>
    <item>
      <pubDate>Thu, 15 Oct 2009 14:40:22 -0400</pubDate>
      <title>Re: xlswrite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263199#687272</link>
      <author>ragab Rabeiy</author>
      <description>&quot;Nasser Abbasi&quot; &amp;lt;nma@12000.org&amp;gt; wrote in message &amp;lt;pQEBm.2947$4E.1354@newsfe08.iad&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;ragab Rabeiy&quot; &amp;lt;r_rabeiy@yahoo.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; news:hb6s4f$evt$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; &amp;gt;i am a new user in Matlab, and i faced small problem, could u please help &lt;br&gt;
&amp;gt; &amp;gt;me??&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; this problem is: for the following code, Matlab writes only in Excel the &lt;br&gt;
&amp;gt; &amp;gt; final value (pi*5),&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; and I want it to write all the data from 1 to 5.&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; for x=1:5;&lt;br&gt;
&amp;gt; &amp;gt; m=pi*x;&lt;br&gt;
&amp;gt; &amp;gt; xlswrite('file.xls', m)&lt;br&gt;
&amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; becuase each time in the loop, you are starting all over and writing to a &lt;br&gt;
&amp;gt; new file.xls. The old file.xls is overwritten. there is no append by &lt;br&gt;
&amp;gt; default.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; As mentiod, no loop is neede, write the whole matrix data in one write. see &lt;br&gt;
&amp;gt; help on how to make different sheets if you want.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; --Nasser &lt;br&gt;
&amp;gt; &lt;br&gt;
Thank you for u replay, &lt;br&gt;
indeed it is only xlswrite test, but i am using it in a larger code, and when I removed for...end, I got error. the following is a larger code but not the largest one, also it is part of my original code.&lt;br&gt;
&lt;br&gt;
clc&lt;br&gt;
%%part of :convert to wind direction &lt;br&gt;
wd=66;&lt;br&gt;
phi=wd*pi/180;&lt;br&gt;
m=xlsread('data', 'point_data','a2:e20');&lt;br&gt;
x=m(:,3); y=m(:,4); z=m(:,5);&lt;br&gt;
n=size(x,1); &lt;br&gt;
for j=1:n;&lt;br&gt;
xr=x(j,:);&lt;br&gt;
yr=y(j,:);&lt;br&gt;
zr=z(j,:);&lt;br&gt;
xs=3589800 ; ys=5741200; zs=511.05;&lt;br&gt;
X=(xr-xs); Y=(yr-ys);&lt;br&gt;
%% convert to wind direction coordinates&lt;br&gt;
theta=atan((xr-xs)/(yr-ys));&lt;br&gt;
x_=((xr-xs)/sin(theta))*cos(phi-theta);&lt;br&gt;
y_=((xr-xs)/sin(theta))*sin(phi-theta);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;C=x_*.25+y_*.025;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;xlswrite ('test.xls',C)&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
the same problem i got only the last C value in the excel sheet. could you help in it please.</description>
    </item>
    <item>
      <pubDate>Thu, 15 Oct 2009 14:42:03 -0400</pubDate>
      <title>Re: xlswrite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263199#687273</link>
      <author>ragab Rabeiy</author>
      <description>&quot;Branko &quot; &amp;lt;bogunovic@mbss.org&amp;gt; wrote in message &amp;lt;hb7104$dus$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;ragab Rabeiy&quot; &amp;lt;r_rabeiy@yahoo.com&amp;gt; wrote in message &amp;lt;hb6s4f$evt$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; i am a new user in Matlab, and i faced small problem, could u please help me??&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; this problem is: for the following code, Matlab writes only in Excel the final value (pi*5),&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; and I want it to write all the data from 1 to 5.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; for x=1:5;&lt;br&gt;
&amp;gt; &amp;gt; m=pi*x;&lt;br&gt;
&amp;gt; &amp;gt; xlswrite('file.xls', m)&lt;br&gt;
&amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Why do you use for loop? No need in this case:&lt;br&gt;
&amp;gt; x=1:5;&lt;br&gt;
&amp;gt; m=pi*x;&lt;br&gt;
&amp;gt; xlswrite('filename.xls', m)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Branko&lt;br&gt;
&lt;br&gt;
Thank you for u replay, &lt;br&gt;
indeed it is only xlswrite test, but i am using it in a larger code, and when I removed for...end, I got error. the following is a larger code but not the largest one, also it is part of my original code.&lt;br&gt;
&lt;br&gt;
clc&lt;br&gt;
%%part of :convert to wind direction &lt;br&gt;
wd=66;&lt;br&gt;
phi=wd*pi/180;&lt;br&gt;
m=xlsread('data', 'point_data','a2:e20');&lt;br&gt;
x=m(:,3); y=m(:,4); z=m(:,5);&lt;br&gt;
n=size(x,1); &lt;br&gt;
for j=1:n;&lt;br&gt;
xr=x(j,:);&lt;br&gt;
yr=y(j,:);&lt;br&gt;
zr=z(j,:);&lt;br&gt;
xs=3589800 ; ys=5741200; zs=511.05;&lt;br&gt;
X=(xr-xs); Y=(yr-ys);&lt;br&gt;
%% convert to wind direction coordinates&lt;br&gt;
theta=atan((xr-xs)/(yr-ys));&lt;br&gt;
x_=((xr-xs)/sin(theta))*cos(phi-theta);&lt;br&gt;
y_=((xr-xs)/sin(theta))*sin(phi-theta);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;C=x_*.25+y_*.025;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;xlswrite ('test.xls',C)&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
the same problem i got only the last C value in the excel sheet. could you help in it please.</description>
    </item>
    <item>
      <pubDate>Thu, 15 Oct 2009 14:59:17 -0400</pubDate>
      <title>Re: xlswrite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263199#687282</link>
      <author>ImageAnalyst</author>
      <description>ragab Rabeiy&lt;br&gt;
Just use sprintf() to create a brand new filename each iteration of&lt;br&gt;
the loop and then write out that uniquely-named file, rather than&lt;br&gt;
overwriting the same file (&quot;test.xls&quot;) each time.  For example&lt;br&gt;
&lt;br&gt;
baseFileName = sprintf('Test %d.xls', j);&lt;br&gt;
folder = 'c:\my output folder';&lt;br&gt;
if ~exist(folder, 'dir')&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mkdir(folder);&lt;br&gt;
end&lt;br&gt;
fullFileName = fullfile(folder, baseFileName);&lt;br&gt;
xlswrite(fullFileName);&lt;br&gt;
&lt;br&gt;
Regards,&lt;br&gt;
ImageAnalyst</description>
    </item>
    <item>
      <pubDate>Thu, 15 Oct 2009 16:59:05 -0400</pubDate>
      <title>Re: xlswrite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263199#687336</link>
      <author>ragab Rabeiy</author>
      <description>ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message &amp;lt;6d40011a-0172-4478-b67c-04c9e03d6aac@a31g2000yqn.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; ragab Rabeiy&lt;br&gt;
&amp;gt; Just use sprintf() to create a brand new filename each iteration of&lt;br&gt;
&amp;gt; the loop and then write out that uniquely-named file, rather than&lt;br&gt;
&amp;gt; overwriting the same file (&quot;test.xls&quot;) each time.  For example&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; baseFileName = sprintf('Test %d.xls', j);&lt;br&gt;
&amp;gt; folder = 'c:\my output folder';&lt;br&gt;
&amp;gt; if ~exist(folder, 'dir')&lt;br&gt;
&amp;gt;     mkdir(folder);&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; fullFileName = fullfile(folder, baseFileName);&lt;br&gt;
&amp;gt; xlswrite(fullFileName);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Regards,&lt;br&gt;
&amp;gt; ImageAnalyst&lt;br&gt;
&lt;br&gt;
thank you ImageAnalyst,&lt;br&gt;
your example seems to be helpful, but i can not understand it. I tried it many times but gave may error also. could you please write a simple one , by which i can make copy and past in command window and it works directly, like&lt;br&gt;
&lt;br&gt;
????&lt;br&gt;
for n=1:5,&lt;br&gt;
m=n*pi&lt;br&gt;
end&lt;br&gt;
xlaswrite.......????&lt;br&gt;
&lt;br&gt;
regards&lt;br&gt;
ragab</description>
    </item>
    <item>
      <pubDate>Thu, 15 Oct 2009 20:20:46 -0400</pubDate>
      <title>Re: xlswrite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263199#687383</link>
      <author>ImageAnalyst</author>
      <description>On Oct 15, 12:59&#160;pm, &quot;ragab Rabeiy&quot; &amp;lt;r_rab...@yahoo.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; ImageAnalyst &amp;lt;imageanal...@mailinator.com&amp;gt; wrote in message &amp;lt;6d40011a-0172-4478-b67c-04c9e03d6...@a31g2000yqn.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; ragab Rabeiy&lt;br&gt;
&amp;gt; &amp;gt; Just use sprintf() to create a brand new filename each iteration of&lt;br&gt;
&amp;gt; &amp;gt; the loop and then write out that uniquely-named file, rather than&lt;br&gt;
&amp;gt; &amp;gt; overwriting the same file (&quot;test.xls&quot;) each time. &#160;For example&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; baseFileName = sprintf('Test %d.xls', j);&lt;br&gt;
&amp;gt; &amp;gt; folder = 'c:\my output folder';&lt;br&gt;
&amp;gt; &amp;gt; if ~exist(folder, 'dir')&lt;br&gt;
&amp;gt; &amp;gt; &#160; &#160; mkdir(folder);&lt;br&gt;
&amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt; &amp;gt; fullFileName = fullfile(folder, baseFileName);&lt;br&gt;
&amp;gt; &amp;gt; xlswrite(fullFileName);&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Regards,&lt;br&gt;
&amp;gt; &amp;gt; ImageAnalyst&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; thank you ImageAnalyst,&lt;br&gt;
&amp;gt; your example seems to be helpful, but i can not understand it. I tried it many times but gave may error also. could you please write a simple one , by which i can make copy and past in command window and it works directly, like&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; ????&lt;br&gt;
&amp;gt; for n=1:5,&lt;br&gt;
&amp;gt; m=n*pi&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; xlaswrite.......????&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; regards&lt;br&gt;
&amp;gt; ragab- Hide quoted text -&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; - Show quoted text -&lt;br&gt;
&lt;br&gt;
------------------------------------------------------------------------------------------------------------------------------------------&lt;br&gt;
Hmmmmm....  It's really not that hard.  Nonetheless, I did this code&lt;br&gt;
for you:&lt;br&gt;
folder = 'C:\Program Files\MATLAB\work';&lt;br&gt;
for loopIndex = 1:3&lt;br&gt;
	baseFileName = sprintf('Test %d.xls', loopIndex);&lt;br&gt;
	if ~exist(folder, 'dir')&lt;br&gt;
		mkdir(folder);&lt;br&gt;
	end&lt;br&gt;
	dataArray = rand(20, 10);&lt;br&gt;
	fullFileName = fullfile(folder, baseFileName);&lt;br&gt;
	xlswrite(fullFileName, dataArray);&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
It works, though it's very slow.  You'd be better off using xlswrite1&lt;br&gt;
() from the File Exchange so that you don't have to open and close&lt;br&gt;
Excel at every loop iteration.&lt;br&gt;
Good luck,&lt;br&gt;
ImageAnalyst&lt;br&gt;
P.S. Above you put the xlswrite outside the loop but in your earlier&lt;br&gt;
posting you had it inside the loop, so I'm not sure what's up with&lt;br&gt;
that.</description>
    </item>
    <item>
      <pubDate>Fri, 16 Oct 2009 08:01:33 -0400</pubDate>
      <title>Re: xlswrite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263199#687468</link>
      <author>ragab Rabeiy</author>
      <description>ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message &amp;lt;5e9ea19c-a0c8-4ea8-a8ce-41222bdbe88f@y21g2000yqn.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On Oct 15, 12:59?pm, &quot;ragab Rabeiy&quot; &amp;lt;r_rab...@yahoo.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; ImageAnalyst &amp;lt;imageanal...@mailinator.com&amp;gt; wrote in message &amp;lt;6d40011a-0172-4478-b67c-04c9e03d6...@a31g2000yqn.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ragab Rabeiy&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Just use sprintf() to create a brand new filename each iteration of&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; the loop and then write out that uniquely-named file, rather than&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; overwriting the same file (&quot;test.xls&quot;) each time. ?For example&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; baseFileName = sprintf('Test %d.xls', j);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; folder = 'c:\my output folder';&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; if ~exist(folder, 'dir')&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ? ? mkdir(folder);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; fullFileName = fullfile(folder, baseFileName);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; xlswrite(fullFileName);&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Regards,&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ImageAnalyst&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; thank you ImageAnalyst,&lt;br&gt;
&amp;gt; &amp;gt; your example seems to be helpful, but i can not understand it. I tried it many times but gave may error also. could you please write a simple one , by which i can make copy and past in command window and it works directly, like&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; ????&lt;br&gt;
&amp;gt; &amp;gt; for n=1:5,&lt;br&gt;
&amp;gt; &amp;gt; m=n*pi&lt;br&gt;
&amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt; &amp;gt; xlaswrite.......????&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; regards&lt;br&gt;
&amp;gt; &amp;gt; ragab- Hide quoted text -&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; - Show quoted text -&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ------------------------------------------------------------------------------------------------------------------------------------------&lt;br&gt;
&amp;gt; Hmmmmm....  It's really not that hard.  Nonetheless, I did this code&lt;br&gt;
&amp;gt; for you:&lt;br&gt;
&amp;gt; folder = 'C:\Program Files\MATLAB\work';&lt;br&gt;
&amp;gt; for loopIndex = 1:3&lt;br&gt;
&amp;gt; 	baseFileName = sprintf('Test %d.xls', loopIndex);&lt;br&gt;
&amp;gt; 	if ~exist(folder, 'dir')&lt;br&gt;
&amp;gt; 		mkdir(folder);&lt;br&gt;
&amp;gt; 	end&lt;br&gt;
&amp;gt; 	dataArray = rand(20, 10);&lt;br&gt;
&amp;gt; 	fullFileName = fullfile(folder, baseFileName);&lt;br&gt;
&amp;gt; 	xlswrite(fullFileName, dataArray);&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; It works, though it's very slow.  You'd be better off using xlswrite1&lt;br&gt;
&amp;gt; () from the File Exchange so that you don't have to open and close&lt;br&gt;
&amp;gt; Excel at every loop iteration.&lt;br&gt;
&amp;gt; Good luck,&lt;br&gt;
&amp;gt; ImageAnalyst&lt;br&gt;
&amp;gt; P.S. Above you put the xlswrite outside the loop but in your earlier&lt;br&gt;
&amp;gt; posting you had it inside the loop, so I'm not sure what's up with&lt;br&gt;
&amp;gt; that.&lt;br&gt;
Hello ImageAnalyst, your code is working, thank you.&lt;br&gt;
but it gives me three exile files. &lt;br&gt;
&lt;br&gt;
When i made the attached code, it gave me 50 files, each one has its iteration value. so, i need all the results to be in a unique file also in a unique sheet. &lt;br&gt;
May you have a suggestion.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&lt;br&gt;
folder ='D:\work';&lt;br&gt;
for n=1:50;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;File=sprintf('Test%d.xls',n);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if~exist(folder,'dir');  mkdir(folder); end&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m=n*pi;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fileName=fullfile(folder,File);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;xlswrite(fileName,m);&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
Regards&lt;br&gt;
Ragab</description>
    </item>
    <item>
      <pubDate>Fri, 16 Oct 2009 11:55:24 -0400</pubDate>
      <title>Re: xlswrite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263199#687523</link>
      <author>ImageAnalyst</author>
      <description>On Oct 16, 4:01&#160;am, &quot;ragab Rabeiy&quot; &amp;lt;r_rab...@yahoo.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; ImageAnalyst &amp;lt;imageanal...@mailinator.com&amp;gt; wrote in message &amp;lt;5e9ea19c-a0c8-4ea8-a8ce-41222bdbe...@y21g2000yqn.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; On Oct 15, 12:59?pm, &quot;ragab Rabeiy&quot; &amp;lt;r_rab...@yahoo.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ImageAnalyst &amp;lt;imageanal...@mailinator.com&amp;gt; wrote in message &amp;lt;6d40011a-0172-4478-b67c-04c9e03d6...@a31g2000yqn.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; ragab Rabeiy&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Just use sprintf() to create a brand new filename each iteration of&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; the loop and then write out that uniquely-named file, rather than&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; overwriting the same file (&quot;test.xls&quot;) each time. ?For example&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; baseFileName = sprintf('Test %d.xls', j);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; folder = 'c:\my output folder';&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; if ~exist(folder, 'dir')&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; ? ? mkdir(folder);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; fullFileName = fullfile(folder, baseFileName);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; xlswrite(fullFileName);&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Regards,&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; ImageAnalyst&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; thank you ImageAnalyst,&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; your example seems to be helpful, but i can not understand it. I tried it many times but gave may error also. could you please write a simple one , by which i can make copy and past in command window and it works directly, like&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ????&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; for n=1:5,&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; m=n*pi&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; xlaswrite.......????&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; regards&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ragab- Hide quoted text -&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; - Show quoted text -&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; ---------------------------------------------------------------------------&#173;---------------------------------------------------------------&lt;br&gt;
&amp;gt; &amp;gt; Hmmmmm.... &#160;It's really not that hard. &#160;Nonetheless, I did this code&lt;br&gt;
&amp;gt; &amp;gt; for you:&lt;br&gt;
&amp;gt; &amp;gt; folder = 'C:\Program Files\MATLAB\work';&lt;br&gt;
&amp;gt; &amp;gt; for loopIndex = 1:3&lt;br&gt;
&amp;gt; &amp;gt; &#160; &#160;baseFileName = sprintf('Test %d.xls', loopIndex);&lt;br&gt;
&amp;gt; &amp;gt; &#160; &#160;if ~exist(folder, 'dir')&lt;br&gt;
&amp;gt; &amp;gt; &#160; &#160; &#160; &#160; &#160; &#160;mkdir(folder);&lt;br&gt;
&amp;gt; &amp;gt; &#160; &#160;end&lt;br&gt;
&amp;gt; &amp;gt; &#160; &#160;dataArray = rand(20, 10);&lt;br&gt;
&amp;gt; &amp;gt; &#160; &#160;fullFileName = fullfile(folder, baseFileName);&lt;br&gt;
&amp;gt; &amp;gt; &#160; &#160;xlswrite(fullFileName, dataArray);&lt;br&gt;
&amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; It works, though it's very slow. &#160;You'd be better off using xlswrite1&lt;br&gt;
&amp;gt; &amp;gt; () from the File Exchange so that you don't have to open and close&lt;br&gt;
&amp;gt; &amp;gt; Excel at every loop iteration.&lt;br&gt;
&amp;gt; &amp;gt; Good luck,&lt;br&gt;
&amp;gt; &amp;gt; ImageAnalyst&lt;br&gt;
&amp;gt; &amp;gt; P.S. Above you put the xlswrite outside the loop but in your earlier&lt;br&gt;
&amp;gt; &amp;gt; posting you had it inside the loop, so I'm not sure what's up with&lt;br&gt;
&amp;gt; &amp;gt; that.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Hello ImageAnalyst, your code is working, thank you.&lt;br&gt;
&amp;gt; but it gives me three exile files.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; When i made the attached code, it gave me 50 files, each one has its iteration value. so, i need all the results to be in a unique file also in a unique sheet.&lt;br&gt;
&amp;gt; May you have a suggestion.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; folder ='D:\work';&lt;br&gt;
&amp;gt; for n=1:50;&lt;br&gt;
&amp;gt; &#160; &#160; File=sprintf('Test%d.xls',n);&lt;br&gt;
&amp;gt; &#160; &#160; if~exist(folder,'dir'); &#160;mkdir(folder); end&lt;br&gt;
&amp;gt; &#160; &#160; m=n*pi;&lt;br&gt;
&amp;gt; &#160; &#160; fileName=fullfile(folder,File);&lt;br&gt;
&amp;gt; &#160; &#160; xlswrite(fileName,m);&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Regards&lt;br&gt;
&amp;gt; Ragab- Hide quoted text -&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; - Show quoted text -&lt;br&gt;
&lt;br&gt;
-------------------------------------------------------------------------------------------&lt;br&gt;
Ragab:&lt;br&gt;
Did you look at the documentation for xlswrite()?&lt;br&gt;
The worksheet name is one of the optional arguments.&lt;br&gt;
Just use sprintf() to create whatever name you want, and pass it in.&lt;br&gt;
Regards,&lt;br&gt;
ImageAnalyst</description>
    </item>
    <item>
      <pubDate>Fri, 16 Oct 2009 16:25:20 -0400</pubDate>
      <title>Re: xlswrite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263199#687610</link>
      <author>ragab Rabeiy</author>
      <description>&lt;br&gt;
&amp;gt; Did you look at the documentation for xlswrite()?&lt;br&gt;
&amp;gt; The worksheet name is one of the optional arguments.&lt;br&gt;
&amp;gt; Just use sprintf() to create whatever name you want, and pass it in.&lt;br&gt;
&amp;gt; Regards,&lt;br&gt;
&amp;gt; ImageAnalyst&lt;br&gt;
&lt;br&gt;
Hello ImageAnalyst, &lt;br&gt;
&lt;br&gt;
I don not ask about the worksheet name, please read my message again. &lt;br&gt;
&lt;br&gt;
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.&lt;br&gt;
note the follwing code:&lt;br&gt;
&amp;nbsp;&lt;br&gt;
folder ='D:\work';&lt;br&gt;
for n=1:50;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;File=sprintf('Test%d.xls',n);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if~exist(folder,'dir'); mkdir(folder); end&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m=n*pi;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fileName=fullfile(folder,File);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;xlswrite(fileName,m);&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
I hope that it not boring for you.&lt;br&gt;
Ragab</description>
    </item>
    <item>
      <pubDate>Fri, 16 Oct 2009 16:50:19 -0400</pubDate>
      <title>Re: xlswrite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263199#687616</link>
      <author>ImageAnalyst</author>
      <description>I read your messag again and you said &quot;be in a unique file also in a&lt;br&gt;
unique sheet.&quot;  So I gave you code to do that.  You have unique files&lt;br&gt;
because it's inside the for loop.  The only way to have unique sheets&lt;br&gt;
(within a single workbook) is to give them different worksheet names.&lt;br&gt;
However if the worksheets are in different workbooks (files) then you&lt;br&gt;
can of course use the same worksheet name.&lt;br&gt;
&lt;br&gt;
But now it appears that perhaps what you really mean is to have a&lt;br&gt;
common Excel file (not separate unique ones), and to put all the&lt;br&gt;
various arrays that you calculate/generate in your loop into one&lt;br&gt;
common file.  Your code does that but the problem with it is that it&lt;br&gt;
puts all your arrays m into the same location.  I'd recommend&lt;br&gt;
calculating a cell reference each pass through your loop, and passing&lt;br&gt;
that in so at least they all get poked into different cells (row/&lt;br&gt;
columns) in the worksheet and don't just keep overwriting the same&lt;br&gt;
location every time.&lt;br&gt;
&lt;br&gt;
Again, this is very slow and you'd be better off using xlswrite1().</description>
    </item>
    <item>
      <pubDate>Fri, 16 Oct 2009 16:58:37 -0400</pubDate>
      <title>Re: xlswrite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263199#687619</link>
      <author>Nathan</author>
      <description>On Oct 16, 9:25&#160;am, &quot;ragab Rabeiy&quot; &amp;lt;r_rab...@yahoo.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; Did you look at the documentation for xlswrite()?&lt;br&gt;
&amp;gt; &amp;gt; The worksheet name is one of the optional arguments.&lt;br&gt;
&amp;gt; &amp;gt; Just use sprintf() to create whatever name you want, and pass it in.&lt;br&gt;
&amp;gt; &amp;gt; Regards,&lt;br&gt;
&amp;gt; &amp;gt; ImageAnalyst&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Hello ImageAnalyst,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I don not ask about the worksheet name, please read my message again.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; 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.&lt;br&gt;
&amp;gt; note the follwing code:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; folder ='D:\work';&lt;br&gt;
&amp;gt; for n=1:50;&lt;br&gt;
&amp;gt; &#160; &#160; File=sprintf('Test%d.xls',n);&lt;br&gt;
&amp;gt; &#160; &#160; if~exist(folder,'dir'); mkdir(folder); end&lt;br&gt;
&amp;gt; &#160; &#160; m=n*pi;&lt;br&gt;
&amp;gt; &#160; &#160; fileName=fullfile(folder,File);&lt;br&gt;
&amp;gt; &#160; &#160; xlswrite(fileName,m);&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I hope that it not boring for you.&lt;br&gt;
&amp;gt; Ragab&lt;br&gt;
&lt;br&gt;
how about within your loop you specify the cells you want to be&lt;br&gt;
written to?&lt;br&gt;
&lt;br&gt;
xlswrite(filename,m,sprintf('A%d',n))&lt;br&gt;
%will write output to cell An, where n is your counter</description>
    </item>
    <item>
      <pubDate>Fri, 16 Oct 2009 18:56:03 -0400</pubDate>
      <title>Re: xlswrite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263199#687645</link>
      <author>Mayur Singh</author>
      <description>Hi Nathan,&lt;br&gt;
&lt;br&gt;
I'm asuming the following :&lt;br&gt;
1. You have no problem in your code if you stored in the variable &quot;m&quot; all the values of n*pi (for n=1 to 50).&lt;br&gt;
&lt;br&gt;
2. You are fine if you wrote all the values of n*pi in the first sheet of an excel file starting from cell &quot;A1&quot;(this assumption is for illustration purposes only and you can play with different options for &quot;woorksheet&quot; and &quot;range&quot; to decide where to write the data in a excel file)&lt;br&gt;
&lt;br&gt;
3.) lets say filename and location is 'C:\test.xls'&lt;br&gt;
&lt;br&gt;
filename = 'C:\test.xls';&lt;br&gt;
m = (1:50)'*pi;&lt;br&gt;
xlswrite(filename,m,1,'A1');&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Nathan &amp;lt;ngreco32@gmail.com&amp;gt; wrote in message &amp;lt;7a1ec1d4-02eb-4504-ba86-a10b62b14976@m3g2000pri.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On Oct 16, 9:25?am, &quot;ragab Rabeiy&quot; &amp;lt;r_rab...@yahoo.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Did you look at the documentation for xlswrite()?&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; The worksheet name is one of the optional arguments.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Just use sprintf() to create whatever name you want, and pass it in.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Regards,&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ImageAnalyst&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Hello ImageAnalyst,&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I don not ask about the worksheet name, please read my message again.&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; 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.&lt;br&gt;
&amp;gt; &amp;gt; note the follwing code:&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; folder ='D:\work';&lt;br&gt;
&amp;gt; &amp;gt; for n=1:50;&lt;br&gt;
&amp;gt; &amp;gt; ? ? File=sprintf('Test%d.xls',n);&lt;br&gt;
&amp;gt; &amp;gt; ? ? if~exist(folder,'dir'); mkdir(folder); end&lt;br&gt;
&amp;gt; &amp;gt; ? ? m=n*pi;&lt;br&gt;
&amp;gt; &amp;gt; ? ? fileName=fullfile(folder,File);&lt;br&gt;
&amp;gt; &amp;gt; ? ? xlswrite(fileName,m);&lt;br&gt;
&amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I hope that it not boring for you.&lt;br&gt;
&amp;gt; &amp;gt; Ragab&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; how about within your loop you specify the cells you want to be&lt;br&gt;
&amp;gt; written to?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; xlswrite(filename,m,sprintf('A%d',n))&lt;br&gt;
&amp;gt; %will write output to cell An, where n is your counter</description>
    </item>
    <item>
      <pubDate>Fri, 16 Oct 2009 21:00:46 -0400</pubDate>
      <title>Re: xlswrite</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/263199#687675</link>
      <author>Nathan</author>
      <description>On Oct 16, 11:56&#160;am, &quot;Mayur Singh&quot; &amp;lt;mayu...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hi Nathan,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I'm asuming the following :&lt;br&gt;
&amp;gt; 1. You have no problem in your code if you stored in the variable &quot;m&quot; all the values of n*pi (for n=1 to 50).&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; 2. You are fine if you wrote all the values of n*pi in the first sheet of an excel file starting from cell &quot;A1&quot;(this assumption is for illustration purposes only and you can play with different options for &quot;woorksheet&quot; and &quot;range&quot; to decide where to write the data in a excel file)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; 3.) lets say filename and location is 'C:\test.xls'&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; filename = 'C:\test.xls';&lt;br&gt;
&amp;gt; m = (1:50)'*pi;&lt;br&gt;
&amp;gt; xlswrite(filename,m,1,'A1');&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Nathan &amp;lt;ngrec...@gmail.com&amp;gt; wrote in message &amp;lt;7a1ec1d4-02eb-4504-ba86-a10b62b14...@m3g2000pri.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; On Oct 16, 9:25?am, &quot;ragab Rabeiy&quot; &amp;lt;r_rab...@yahoo.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Did you look at the documentation for xlswrite()?&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; The worksheet name is one of the optional arguments.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Just use sprintf() to create whatever name you want, and pass it in.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Regards,&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; ImageAnalyst&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Hello ImageAnalyst,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I don not ask about the worksheet name, please read my message again.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; 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.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; note the follwing code:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; folder ='D:\work';&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; for n=1:50;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ? ? File=sprintf('Test%d.xls',n);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ? ? if~exist(folder,'dir'); mkdir(folder); end&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ? ? m=n*pi;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ? ? fileName=fullfile(folder,File);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ? ? xlswrite(fileName,m);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I hope that it not boring for you.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Ragab&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; how about within your loop you specify the cells you want to be&lt;br&gt;
&amp;gt; &amp;gt; written to?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; xlswrite(filename,m,sprintf('A%d',n))&lt;br&gt;
&amp;gt; &amp;gt; %will write output to cell An, where n is your counter&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;br&gt;
Just a note: Why were you addressing me?&lt;br&gt;
&lt;br&gt;
-Nathan</description>
    </item>
  </channel>
</rss>

