File: BasicTasksS01.htm

package info (click to toggle)
extrema 4.4.4.dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 19,416 kB
  • ctags: 6,689
  • sloc: cpp: 88,991; sh: 8,229; makefile: 480
file content (30 lines) | stat: -rw-r--r-- 1,034 bytes parent folder | download | duplicates (2)
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>Create arrays of numerical values</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">

<P>
 Create the array of square roots of <code>n</code> for <code>n=1,2,...,9</code>.</P>
<P>
 <CODE><font color="blue">a1 = sqrt([1:9])</font></CODE></P>
<P>
 Create an array of <code>15</code> random real values uniformly distributed between
 <code>0</code> and <code>10</code>.</P>
<p>
 <CODE><font color="blue">generate/random a2 0 10 15</font></code><br />
 or<br />
 <CODE><font color="blue">a2 = ran([0:15])*10</font></code></P>
<P>
 Create a <code>5&times;3</code> array of integers chosen randomly between <code>1</code>
 and <code>100</code>.</P>
<P>
 <CODE><font color="blue">a3 = fold(int(ran([1:15])*99+1),5)</font></code></P>
<P>
 <a href="BasicTasks.htm"><img src="../shadow_left.gif">&nbsp;
 <font size="+1" color="olive">Basic tasks</font></a><br />
 <a href="BasicTasksS02.htm"><img src="../shadow_right.gif">&nbsp;
 <font size="+1" color="olive">Create and plot an array</font></a>
</P>
</BODY>
</HTML>