views:

1634

answers:

5

What is the simplest way to programmatically export Excel data to Matlab?

+4  A: 

If there's not much text annotation in the Excel file, save it as a csv, then use the MATLAB function csvread.

Scottie T
+1  A: 

For a bit of $$$, you can get the MATLAB add-on Excel Link, which provides a nice clean interface for transferring data back and forth between the two programs.

Scottie T
+7  A: 

If you are running Matlab on Windows with Excel installed, try XLSREAD.

Jouni K. Seppänen
A: 

The xlsread function that Jouni mentioned works well. If you want some finer control over Excel consider using ActiveX to interact with the Excel file. Check out the MATLAB help for http://www.google.ca/search?hl=en&q=matlab+activex&btnG=Google+Search&meta=">COM client support. I've used this approach to create Excel files but you could also use it to implement advanced programmatic reading of files.

b3
A: 

As has been said, XLSREAD is the right function for the job. On a non-Windows system it will also work without Excel installed. However, it supposedly lacks some of Excels advanced features.

BastiBechtold