Code covered by the BSD License  

Highlights from
XLSWriteMex

4.83333

4.8 | 7 ratings Rate this file 8 Downloads (last 30 days) File Size: 38.54 KB File ID: #4599

XLSWriteMex

by Gordon Ray

 

09 Mar 2004 (Updated 24 Mar 2004)

MATLAB MEX function to create an Excel spreadsheet.

| Watch this File

File Information
Description

Functionally the same xlswrite.m (by Scott Hirsch), the only difference is in the implementation.

XLSWriteMex is implemented in C++ and compiled into a MATLAB MEX dll. I did this because 'xlswrite.m' does not compile using the MATLAB compiler, so any MATLAB program using 'xlswrite.m' cannot be compiled into a stand-alone app.

Using XLSWriteMex instead of xlswrite will solve this problem.

Example using XLSWriteMex:
m = rand(100,4);
header = 'This is some introductory information at the top of my spreadsheet.';
colnames = {'Ch1','Ch2','Ch3','Ch4'};
filename = 'myfile.xls';
XLSWriteMex(m,header,colnames,filename);

Will create a spreadsheet named myfile.xls

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
xlswrite
This submission has inspired the following:
Example of how to save or read data to an Excel archive.

MATLAB release MATLAB 6.5 (R13)
Other requirements Microsoft Excel
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (10)
15 Apr 2004 martyn dorey

Nice

17 Oct 2004 Jean Ghanem

Very nice

10 Dec 2004 Garner Zuir

Interesting and useful

30 Mar 2008 Wan an Cui

very good!

30 Mar 2008 Wan an Cui  
30 Mar 2008 Wan an Cui

Very good! If the author can add path to the created file,it will be more excellent.
For example, I hope the created file in "D:\mywork\Matlab",but I do not know how to realize it. Thanks the author.

16 Jun 2008 Liaquat Iqbal  
17 Feb 2010 George

Is there a way to use the functionality of the built in xlswrite function with this file?
Instead of "XLSWriteMex(m,header,colnames,filename)"
is there a way to use "xlswrite(File,data,sheet,location)" in a compiled version?

11 Oct 2010 Mechanical Design Engineering Mohamed

Where to paste this file??
i have an error undefined function or command

26 May 2011 Daniele

It's not clear how the DLL should be loaded. Where does the file/folder need to be placed? Does it need to be loaded with 'loadlibrary'? Please include a readme file with instructions. Thanks

Please login to add a comment or rating.
Updates
24 Mar 2004

Changed category from
'Utilities: Miscellaneous' to
'Utilities: Data Import/Export'

Tag Activity for this File
Tag Applied By Date/Time
data import Gordon Ray 22 Oct 2008 07:15:58
data export Gordon Ray 22 Oct 2008 07:15:58
write Gordon Ray 22 Oct 2008 07:15:58
excel Gordon Ray 22 Oct 2008 07:15:58
spreadsheet Gordon Ray 22 Oct 2008 07:15:58
mex Gordon Ray 22 Oct 2008 07:15:58
dll Gordon Ray 22 Oct 2008 07:15:58

Contact us at files@mathworks.com