{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

6_pdfsam_3 - save data2.dat a-ascii This command causes...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
save data2.dat a -ascii This command causes each row of the array a (more on arrays later) to be written to a separate line in the data file. Array elements on a line are separated by spaces. The separating character can be made a tab with the command: save data2.dat a -ascii -tab The .mat extension is not added to an ASCII text file. However, it is recommended that ASCII text file names include the extension .dat so that it is easy to distinguish them from MAT-files and M-files (to be described in the next section). For an example of importing text data, suppose that a text file named data3.dat contains a set of values that represent the time and corresponding distance of a runner from the starting line in a race. Each time and its corresponding distance value are on a separate line of the data file. The values on a line must be separated by one or more spaces. Consider a data file named data3.dat containing the following: 0.0 0.0 0.1 3.5 0.2 6.8 The load
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}