File: BasicTasksS14.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 (62 lines) | stat: -rw-r--r-- 1,600 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<HTML>
<HEAD>
<TITLE>Display array data as contours and density plot</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">

<P>
 Create a <code>32&times;32</code> array <code>Z</code>, where
 <code>Z(x,y) = exp(-((x/15)^2+(y/12)^2))</code> for <code>-5 &le; x &le; 26</code>
 and <code>-10 &le; y &le; 10</code>.
 Display as a contour plot and as density plots.</P>
<P>
 The following script will perform the desired operations:</P>
<P>
 <font color="blue"><pre>
 generate x -5,,26 32
 generate y -10,,10 32
 matrix z 32 32
 do j=[1:32]
   do k=[1:32]
     z[k,j] = exp(-((x[j]/15)^2+(y[k]/12)^2))
   enddo
 enddo
 window 5
 contour\legend x y z 20
 window 6
 set colormap thermal
 density x y z
 window 7
 density\diffusion x y z
 window 8
 density\dithering x y z
 </pre></font></P>
<P>
 <IMG SRC="BasicTasksS14I01.gif"></P>
<P>
 Read <code>32&times;24</code> elevation data from file <a href="BasicTasksS14D01.dat">e.dat</a>.<br />
 Display as a contour map and as density plots.</P>
<P>
 <font color="blue"><pre>
 read\matrix e.dat elevation 32 24
 window 5
 contour\legend elevation 15
 window 6
 set colormap topo256
 density elevation
 window 7
 set colormap gray256
 density elevation
 window 8
 density\diffusion elevation
 </pre></font></P>
<P>
 <IMG SRC="BasicTasksS14I02.gif"></P>
<P>
  <a href="BasicTasksS13.htm"><img src="../shadow_left.gif">&nbsp;
    <font size="+1" color="olive">Analyze data using FFT</font></a><br />
  <a href="BasicTasksS15.htm"><img src="../shadow_right.gif">&nbsp;
    <font size="+1" color="olive">Plot parametric functions</font></a></P>
</BODY>
</HTML>