sbashford/excelMatl​ab

This provides a simple interface for reading/writing Microsoft Excel files from MATLAB.
58 Downloads
Updated 6 Jun 2017

Why not just use xlswrite()?
When called more than ~3 times, xlswrite() is an expensive function in terms of time. excelMatlab provides a simple, optimized approach to writing Excel files when multiple calls are needed. Moreover, xlswrite() requires a string (such as 'A1:B3') representing the range of cells to write. Programmatically this is inconvenient. excelMatlab requests the row and column number of the upper left cell from which to write.

Examples

Open file called fileName and write random matrix to sheet called sheetName. The matrix will be anchored to its top left corner, specified by row 1 and column 5 (cell E1).

fullPathToFile = [pwd(), filesep(), 'fileName'];
myExcel = ExcelMatlab(fullPathToFile, 'w');
data = rand(20);
sheet = 'sheetName';
row = 1;
col = 5;
myExcel.writeToSheet(data, sheet, row, col);
Open file called fileName and read cell G8 from sheet called sheetName.

fullPathToFile = [pwd(), filesep(), 'fileName'];
myExcel = ExcelMatlab(fullPathToFile);
sheet = 'sheetName';
row = 8;
col = 7;
cellRead = myExcel.readCell(sheet, row, col);

Cite As

Seth Bashford (2024). sbashford/excelMatlab (https://github.com/sbashford/excelMatlab), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2017a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes
1.1.0.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.