View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Load Open Document Spreadsheets

4.0 | 3 ratings Rate this file 6 Downloads (last 30 days) File Size: 2.34 KB File ID: #18222 Version: 1.1

Load Open Document Spreadsheets



04 Jan 2008 (Updated )

Loads a spreadsheet in the open document format (used by programs like Open Office) into a cell arra

| Watch this File

File Information

The function provides a simple method with which one can load the contents of open document spreadsheets into MATLAB. Allowing users to directly import files created by Open Office into MATLAB.

Provided with the filename of the spreadsheet the function will import the contents into a MATLAB cell array. The function handles the presence of multiple worksheets by allowing the user to specify a particular worksheet to import.

The function has not undergone rigorous testing, but it has worked for all of my needs. Also, I think a similar method may be implemented to allow one to export data from MATLAB into open document spreadsheets.


This file inspired Rosin Rammler Diagram Plotting Tool.

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (9)
04 Jul 2011 K

K (view profile)

Sorry, didn't include the most important part of the error message:

??? Attempt to reference field of non-structure array.

Error in ==> loadods at 57
nodes = node.getChildNodes

Comment only
04 Jul 2011 K

K (view profile)

Thank you for developing this very useful function. I was wondering if you could help me with a problem in using it.

When I try to use loadods(), I get the following error:

Error in ==> loadods at 57
nodes = node.getChildNodes

This error comes up even with the simplest ods file (1 sheet, 3 numbers). The temporary file content.xls seems to contain correct information.

Would really appreciate your help with this!

Comment only
02 Feb 2010 Stefan

Stefan (view profile)

OK, submitting a new file was not a good idea. Here are my changed lines:

23 function data = loadods_2010_02_02(filepath,filename,options)

26 if nargin<3, options = []; end

31 if exist([filepath filename])~=2

42 unzip([filepath filename],dir_temp);

Note: the filename of the tool must be loadods_2010_02_02.m or change line 23

Comment only
02 Feb 2010 Stefan

Stefan (view profile)

Thank for the tool. Now I don't have to use microsoft excel.
Seems to be working on matlab 6.5 R13, too. But there is an issue using filenames containing a complete path (like c:\myfiles\testfile.ods). The line 36 'if ~mkdir(tempdir,filename) fails and the result is 'permission error'. My solution: separating path and filename: loadods(filepath, filename, options).
There are some necessary changes in the lines 23, 26, 31 and 42. I'll try to upload my version (loadods_2010_02_02.m).

Comment only
30 Oct 2009 Ilya

Ilya (view profile)

25 Jun 2009 diego fonseca

20 Apr 2009 diego fonseca

I made an open office spread sheet, in ods file I made 2 sheets called sheet1 and sheet2, both have different numbers. When I write loadods('filename.ods','sheet1') it gives me a warning saying: MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details.
Also when I load the second sheet it only displays the first sheet. Is there a bug in the program or I am doing something wrong?

Comment only
21 Jan 2009 Steven

Steven (view profile)

This is a great tool. I started writing one myself but found this instead. Thanks. Now for the writeods.m tool. Mathworks should put this into their standard toolbox soon.

23 Jul 2008 Andrew Wagner

I too would love to have an ods exporter

Comment only
07 Jul 2009 1.1

Updated for BSD licensing change

Contact us