Repository URL to install this package:
|
Version:
4.4.5.dfsg-3ubuntu2 ▾
|
<HTML>
<HEAD>
<TITLE>Write data to a file</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<p>
Create a <code>10×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×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="BasicTasksS15.htm"><img src="../shadow_left.gif">
<font size="+1" color="olive">Plot parametric functions</font></a></P>
</BODY>
</HTML>