Prev: NDFT
Next: FFT Scale Factor
From: David on
Hi, I tried to use xlswrite function to write cell arrays to excel files. Since there are many cell arrays that I want to write, I use loops for the process. The problem is that "save as" dialog boxes pop up once in a while asking me to save the excel file, which should be saved automatically, when the program is running. Could anyone help me with this issue? Thanks a lot.
From: ImageAnalyst on
David
I've not seen that. However, you should use xlswrite1() in the
FileExchange rather than xlswrite() if you plan on doing a lot of
pokes. With xlswrite, it launches, pokes, and shuts down Excel with
every call and that's why it's so incredibly slow. One benefit (other
than the big speed-up) may be the greater control you have over when
things happen may get rid of those prompts. That is, the file gets
saved only when you tell it to save.
From: David on
Thanks a lot for the info. I checked xlswrite1() file, but I don't think it will help a lot in my case. I am writing a cell array to a xls file in each loop, and the file names are different among loops. So I have to creat, open, write and close once for every file. And the pop up thing really anoyed me a lot. One more detail is that when it pops up for 'save as', the file which is supposed to store the data is already created. To give you a snapshot, my program is somewhat like this:

for i:n
filename=['C:\Documents\MATLAB\scoreIdeas\scoreIdeas',char(i)];
xlswrite(filename,rawTrades); % rawTrades is the cell array, varies from loops
end

ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <238d5294-4dac-437a-9873-2aee667dfb2f(a)q23g2000yqd.googlegroups.com>...
> David
> I've not seen that. However, you should use xlswrite1() in the
> FileExchange rather than xlswrite() if you plan on doing a lot of
> pokes. With xlswrite, it launches, pokes, and shuts down Excel with
> every call and that's why it's so incredibly slow. One benefit (other
> than the big speed-up) may be the greater control you have over when
> things happen may get rid of those prompts. That is, the file gets
> saved only when you tell it to save.
From: ade77 on
"David " <shuai.hou(a)firstcoverage.com> wrote in message <hmh4g6$mto$1(a)fred.mathworks.com>...
> Thanks a lot for the info. I checked xlswrite1() file, but I don't think it will help a lot in my case. I am writing a cell array to a xls file in each loop, and the file names are different among loops. So I have to creat, open, write and close once for every file. And the pop up thing really anoyed me a lot. One more detail is that when it pops up for 'save as', the file which is supposed to store the data is already created. To give you a snapshot, my program is somewhat like this:
>
> for i:n
> filename=['C:\Documents\MATLAB\scoreIdeas\scoreIdeas',char(i)];
> xlswrite(filename,rawTrades); % rawTrades is the cell array, varies from loops
> end
>

David,
There is no reason why that pop up should be appearing. Use proper functions anyway.

filename = 'C:\Documents\MATLAB\scoreIdeas\scoreIdeas';
for i = 1:n
.......
actual_file = strcat(filename,num2str(i))
xlswrite(actual_file ,rawTrades);

I do this all the time, and I do not get the annoying pop up
From: David on
Hi ade77,

I tried your way, justing change the way I name the file. It works well for a long time but eventually a pop up showed up and ruined the process. I think this might be some issue about how my excel and matlab is installed.

"ade77 " <ade100a(a)gmail.com> wrote in message <hmh7le$ldn$1(a)fred.mathworks.com>...
> "David " <shuai.hou(a)firstcoverage.com> wrote in message <hmh4g6$mto$1(a)fred.mathworks.com>...
> > Thanks a lot for the info. I checked xlswrite1() file, but I don't think it will help a lot in my case. I am writing a cell array to a xls file in each loop, and the file names are different among loops. So I have to creat, open, write and close once for every file. And the pop up thing really anoyed me a lot. One more detail is that when it pops up for 'save as', the file which is supposed to store the data is already created. To give you a snapshot, my program is somewhat like this:
> >
> > for i:n
> > filename=['C:\Documents\MATLAB\scoreIdeas\scoreIdeas',char(i)];
> > xlswrite(filename,rawTrades); % rawTrades is the cell array, varies from loops
> > end
> >
>
> David,
> There is no reason why that pop up should be appearing. Use proper functions anyway.
>
> filename = 'C:\Documents\MATLAB\scoreIdeas\scoreIdeas';
> for i = 1:n
> ......
> actual_file = strcat(filename,num2str(i))
> xlswrite(actual_file ,rawTrades);
>
> I do this all the time, and I do not get the annoying pop up
 |  Next  |  Last
Pages: 1 2
Prev: NDFT
Next: FFT Scale Factor