root/library/doc/tutorial/itfile.dox @ 897

Revision 272, 0.9 kB (checked in by smidl, 16 years ago)

Examples

Line 
1/*!
2\page itfile Writing and reading data from files
3
4Here we will use the \c it_file class to store some data. The program \c
5write_it_file.cpp looks as follows:
6
7\include write_it_file.cpp
8
9When you run this program you will obtain a file called \c it_file_test.it
10in your current directory. You can read the file into Matlab/Octave to view
11the data by using the following commands:
12
13\code
14itload('it_file_test.it')
15figure(1); clf;
16plot(a)
17\endcode
18
19Note: Make sure that <tt>$PREFIX/share/itpp</tt> is in your Matlab/Octave
20path and that you run the code above from the directory where \c
21it_file_test.it is located (\c $PREFIX is the IT++ installation prefix;
22<tt>/usr/local</tt> by default).
23
24The IT++ program \c read_it_file.cpp that reads the file and prints its
25content can look like this:
26
27\include read_it_file.cpp
28
29Here is the output of the program:
30
31\verbatim
32a = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20]
33\endverbatim
34*/
Note: See TracBrowser for help on using the browser.