23.06.2015 Views

MATLAB Programming

MATLAB Programming

MATLAB Programming

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Working with Spreadsheets<br />

Working with Spreadsheets<br />

Youcanuse<strong>MATLAB</strong>toimportandexportdatatothefollowingtypesof<br />

spreadsheets:<br />

• “Microsoft Excel Spreadsheets” on page 6-97<br />

• “Lotus 123 Spreadsheets” on page 6-100<br />

Microsoft Excel Spreadsheets<br />

This section covers<br />

• “Getting Information About the File” on page 6-97<br />

• “Exporting to the File” on page 6-98<br />

• “Importing from the File” on page 6-99<br />

See the xlsfinfo, xlswrite, andxlsread reference pages for more detailed<br />

information and examples.<br />

Getting Information About the File<br />

Use the xlsfinfo function to determine if a file contains a readable Microsoft<br />

Excel spreadsheet.<br />

Inputs to xlsfinfo are<br />

• Name of the spreadsheet file<br />

Outputs from xlsfinfo are<br />

• String 'Microsoft Excel Spreadsheet' if the file contains an Excel<br />

worksheet readable with the xlsread function. Otherwise, it contains<br />

anemptystring('').<br />

• Cell array of strings containing the names of each worksheet in the file.<br />

Example — Querying an XLS File. This example returns information<br />

about spreadsheet file tempdata.xls:<br />

[type, sheets] = xlsfinfo('tempdata.xls')<br />

6-97

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!