The X Collection
编者注: This file was selected as MATLAB Central Pick of the Week
The X collection is a set of Matlab programs that make it easier for the user to interact with Excel sheets. Matlab offers already many ways of exchanging data with Excel. For instance 'xlsread' and 'xlswrite' allow the programmer to read data from and write data into Excel worksheets. But these programs are inefficient when a large number of read and write operations have to be repeated because they build a connection to the Excel COM server and then release this connection again with every operation.
The X collection splits that up. The programmer creates a connection to Excel (with XConnect), then does whatever he or she has to do (XWrite, XRead, XOpenBook, XGetSheet, XSaveBook etc), and then releases the Excel connection again (XDisconnect). Depending on the type of work, the gain in speed range from none at all to orders of magnitude.
The following programs are included: XConnect, XDisconnect, XListOpenBooks, XGetBook, XNewBook, XOpenBook, XFetch, XSaveBook, XSaveAllBooks, XCloseBook, XCloseAllBooks, XListSheets, XGetSheet, XAddSheet, XRead, XWrite, XWriteDates, XDateFmt, XRangeAddress.
Their meanings should be more or less obvious. They all come with help, so that you user should be able to figure out how to use these programs fairly easily. There is also a short documentation (PDF file) as well as an example script (examples.m) that demonstrates many of these programs.
Should you need help with this, please contact me. If you find this contribution useful, please comment below.
引用格式
Yvan Lengwiler (2024). The X Collection (https://www.mathworks.com/matlabcentral/fileexchange/48551-the-x-collection), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
平台兼容性
Windows macOS Linux类别
- MATLAB > Data Import and Analysis > Data Import and Export > Standard File Formats > Spreadsheets >
- MATLAB > External Language Interfaces > COM with MATLAB > Use COM Objects in MATLAB >
标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!版本 | 已发布 | 发行说明 | |
---|---|---|---|
1.5.0.0 | Access to online worksheets was possible with XOpenBook already, but XFetch provides even easier access to files on Yahoo Finance, Google Finance, FRED Database of the FRB St.Louis, and Penn World Table 8.0. |
||
1.4.0.0 | XOpenBook now handles Excel files that are online and opens them directly |
||
1.3.0.0 | XWrite now also handles tables. |
||
1.2.0.0 | New support for exporting Matlab figures into Excel worksheets (with XWrite)
|
||
1.1.0.0 | improved error messages in functions,
|
||
1.0.0.0 |