How to insert data in to a excel file?

2 ビュー (過去 30 日間)
Faranak
Faranak 2014 年 1 月 24 日
回答済み: Image Analyst 2014 年 1 月 24 日
Hello all, I have a program which gives me 240 data,I want to put this 240 data in a excel file. for every column I have 20 data,I mean 20 data for File a,20 data for File d, 20 for R,20 for Maximum value and 20 for x and 20 for y. afilename is the name of the variable of the File a which is different in every 20 data. and also for dfilename and r and maximum and mim1 and nim1 . All of them are variable for their data which are changing in every time I run the program. Can anyone help me in this?
ex = {'File a','File d','r','Maximum Value','x','y'; afilename ; dfilename ; r ; maximum ; mim1 ; nim1 }; xlswrite('Subtract1', ex, 1, 'A1')

採用された回答

Image Analyst
Image Analyst 2014 年 1 月 24 日
You can use xlswrite() and it will work, but it will take a long time for 20 files, since it has to launch Excel 20 times and shutdown Excel 20 times. Better is to use ActiveX. It's more complicated programming but it's a lot faster since you only have to launch Excel once. I've attached a demo below in blue text.

その他の回答 (1 件)

Amit
Amit 2014 年 1 月 24 日
編集済み: Amit 2014 年 1 月 24 日
row_headers = {'File a','File d','r','Maximum Value','x','y'};
data = [afilename dfilename r maximum mim1 nim1]; % I am assuming they are column vectors
xlswrite('Subtract1.xls',row_headers,'Sheet1','A1');
xlswrite('Subtract1.xls',data,'Sheet1','A2');

カテゴリ

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