Software tutorial/Loading data in MATLAB or Python
Jump to navigation
Jump to search
A number of people asked me how to load data into MATLAB and Python after our class on the poor ability of spreadsheets to do serious engineering calculations.
Here are some functions that you can use in either language.
File format | MATLAB | Python |
---|---|---|
Excel files |
xlsread(...) and xlswrite(...) Can read both the text and values in an Excel file. Cell containing formulas are imported as the result of the formula value. |
Excel files in Python |
Comma-separated value (CSV) files are a standard format for many years and can be read on any system, since they are pure text files. | csvread(...) and csvwrite(...) | CSV in Python |
XML files are rapidly becoming a fairly standard import and export format for data, because it describes both the data and the nature of the data in the file. |
xmlread(...) and xmlwrite(...). |
XML Python |