7

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

5 Answers 5

7

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

Sign up to request clarification or add additional context in comments.

2 Comments

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 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.
Note that having Excel installed is no longer a requirement. mathworks.nl/help/matlab/ref/xlsread.html
4

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

Comments

3

In more recent Matlab releases there are also csvread() and writetable() that work with csv which can easily be opened in Excel.

Comments

1

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.

Comments

1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.