File: writedata.htm

package info (click to toggle)
extrema 4.3.6-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 19,212 kB
  • ctags: 6,452
  • sloc: cpp: 86,428; sh: 8,229; makefile: 814
file content (30 lines) | stat: -rw-r--r-- 1,010 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<HTML>
<HEAD>
<TITLE>Write data to a file</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">

<p>
 Create a <code>10&times;3</code> array <code>A</code> where the first column are the
 <code>x</code> values <code>1</code>
 through <code>10</code>, the second column are the <code>y</code> values where
 <code>y(x) = sqrt(x)</code> and the third column are the <code>z</code> values where
 <code>z = x^2</code>.  Write the values of <code>A</code> to file <code>A.dat</code>,
 one row per line. Generate a <code>7&times;11</code> matrix <code>R</code> of random
 values (uniform on <code>[0,1]</code>), and write this matrix to file
 <code>ranm.dat</code>.</P>
<P>
 <font color="blue"><pre>
 x = [1:10]
 A[1:10,1] = x
 A[1:10,2] = sqrt(x)
 A[1:10,3] = x^2
 write\matrix 'A.dat' A
 R = fold(ran([1:77]),7)
 write\matrix 'ranm.dat' R
 </pre></font></P>
<P>
 <a href="parametric.htm"><img src="../shadow_left.gif">&nbsp;
 <font size="+1" color="olive">Plot parametric functions</font></a></P>
</BODY>
</HTML>