フィルターのクリア

How continuously saved to excel file

4 ビュー (過去 30 日間)
BB
BB 2012 年 11 月 13 日
My workspace have A1 ~ A100 ,total 100 matrix
I want to save it as a excel file, the file name is the same as A1.csv ....
A100.csv
how to do it?
Thanks~!

回答 (4 件)

Rica
Rica 2012 年 11 月 13 日
Hi!
xlswrite('data.xls', {'title1' 'title2' 'title3'}, 'Sheet1', 'A1')
xlswrite('tempdata1.xls', ['data1 data2 data3'], 'Sheet1', 'A1')
  1 件のコメント
BB
BB 2012 年 11 月 13 日
HI.but I steel don't know how to write excel file continuously.

サインインしてコメントする。


Image Analyst
Image Analyst 2012 年 11 月 13 日
Evidently you don't want xlswrite(). You said you want csv files, so you need to use csvwrite(). You can't write continously, unless you open the file with fopen(), and write stuff out line by line with fprintf().

BB
BB 2012 年 11 月 13 日
編集済み: BB 2012 年 11 月 13 日
This is my code
for d=1:100;
eval(['csvwrite(''A',num2str(d),'.csv'')','=A',num2str(d)]);
end
what wrong about me?
  1 件のコメント
Image Analyst
Image Analyst 2012 年 11 月 13 日
編集済み: Image Analyst 2012 年 11 月 13 日
Well for one thing, you gave this as an answer when you should have edited your question. Next, this will not produce csv files - it will produce xls workbooks. Third, this will take an eternity because you will have to launch Excel and shutdown Excel 100 times. Use ActiveX if you want to do more than 1 or two writes to a workbook(s). Check out xlswrite1() in the File Exchange for instructions on how to use ActiveX. And finally, you didn't format your code as code. Highlight your code and click the {}Code icon to make it look like code.

サインインしてコメントする。


Jan
Jan 2012 年 11 月 13 日
Remark: Using "A1" to "A100" is a bad idea. Using a cell "A{1}" to "A{100}" is much more useful, because you could process the data in a loop without the need to call the evil and confusing EVAL.
  1 件のコメント
BB
BB 2012 年 11 月 14 日
THANK YOU~

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by