Interfacing MATLAB and EXCEL
The first very basic things you may want to know are how to write and read from an .xls file.
- xlswrite: xlswrite(filename, M) writes matrix M to the Excel file filename. The filename input is a string enclosed in single quotation marks, and should include the file extension. The matrix M is an m-by-n numeric or character array. xlswrite writes the matrix data to the first worksheet in the file, starting at cell A1. For more click here.
- xlsread: num = xlsread(filename) returns numeric data in double array num from the first sheet in the Microsoft Excel spreadsheet file named filename. The filename argument is a string enclosed in single quotation marks. For more click here.
- Sometimes may also be useful the xlsfinfo to determine whether file contains a Microsoft Excel spreadsheet
And if you want to build an external application like a MATLAB made excel add-in you may want to give a look at:
- MATLAB Builder EX 1.2.13 : Deploy MATLAB code as Microsoft Excel add-ins.MATLAB® Builder™ EX lets you integrate MATLAB® applications into your organization’s Excel® workbooks as macro functions or add-ins that can be deployed royalty free. The MATLAB Builder EX product creates the add-ins by encrypting your MATLAB functions, packaging the functions as a DLL that is accessible from Excel, and generating a Microsoft® Visual Basic® for Applications (VBA) wrapper around them.
To edit properties of an xls file:
- Simple Excel sheet editing program: With this program you can edit simple things in an Excel sheet like:
Bold, Fontsize, border, font
To Add a figure into an excel spreadsheet:
- xlswritefig: XLSWRITEFIG allows you to programmatically place a MATLAB figure inside of an Excel spreadsheet. This can be a useful supplement to XLSWRITE.
You may also want a speed up:
- xlsread.m for faster data transfer:This modified version makes the original xlsread.m faster and also allows add-ins to be loaded.
If you are working with temporal data:
- xlsdate.m: converts a MS Excel date to year, month and day
And if you have 3D arrays:
- xlswrite 3D: xlswrite is limited to writing 2D arrays to Excel. This is a simple function that allows you to write 3D arrays to Excel
Ok something is not clear, but don’t worry, here is some tutorial:
- Graphical tutorial: importing data from Excel: This graphical tutorial shows how to bring data in from Excel and create a plot from it. Sample data file is included. Graphical tutorial is done in PowerPoint. Print in color if you can. Right click on the file .PPS to print once downloaded.
- Data Analysis with MATLAB for Excel Users: material from a matlab webinar.
Popularity: 1% [?]
Related Posts
Comments
One Comment on Interfacing MATLAB and EXCEL
-
Chris R on
Thu, 12th Aug 2010 17:54
This GUI is very versatile and will import excel data and create different types of 3D maps.
http://www.mathworks.com/matlabcentral/fileexchange/28177-3d-performance-map-gui
Hope this helps,
Chris
[Reply]
Tell me what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!
Include MATLAB code in your comment by doing the following:
<pre lang="MATLAB">
%insert code here
</pre>


















































