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.

Using the Import Wizard<br />

John 1x3 24 double<br />

Martin 1x3 24 double<br />

Rob 1x3 24 double<br />

Writing Data to the Workspace<br />

To complete the import operation, click Finish to bring the data into the<br />

<strong>MATLAB</strong> workspace. This button also dismisses the Import Wizard.<br />

Variables written to the workspace are in one of the following formats. The<br />

first three apply only to data read from text files or the clipboard, the fourth<br />

applies only to binary files, and the last applies to both:<br />

Variable Name<br />

data, textdata, rowheaders,<br />

colheaders<br />

Variables named after row or<br />

column headers<br />

Single variable named after the<br />

filename, or A_pastespecial<br />

Variable names taken from<br />

binary file<br />

Output variable assigned during<br />

call to uiimport<br />

Output<br />

Separate matrices for numeric, text, and<br />

header data.<br />

One vector for each row or column.<br />

One matrix for all data named after the<br />

filename<br />

Data assigned to each variable stored in<br />

a binary file.<br />

A single structure having fields that<br />

match one of the formats described<br />

above.<br />

Examples<br />

Here are a few examples of how to use the Import Wizard.<br />

Example 1—Text Data. Start by creating the text file grades.txt using<br />

the<strong>MATLAB</strong>editor. Thefilecontainsthefollowing:<br />

John 85 90 95<br />

Ann 90 92 98<br />

Martin 100 95 97<br />

Rob 77 86 93<br />

6-19

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

Saved successfully!

Ooh no, something went wrong!