home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / r / rlab / Docs / rlabp_tex / node50_ct.html < prev    next >
LaTeX Document  |  1995-01-14  |  5.3 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: LaTeX Document (document/latex).

You can browse this item here: node50_ct.html

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
90% dexvert Hypertext Markup Language File (text/html) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file HTML document text default (weak)
99% file LaTeX document text default
98% file exported SGML document text default
97% file exported SGML document, ASCII text default
80% TrID HyperText Markup Language with DOCTYPE default
19% TrID HyperText Markup Language default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/281 LaTeX (Subdocument) default
100% gt2 HTML (Hyper Text Markup Language) Datei default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime text/html default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 3c 21 44 4f 43 54 59 50 | 45 20 48 54 4d 4c 20 50 |<!DOCTYP|E HTML P|
|00000010| 55 42 4c 49 43 20 22 2d | 2f 2f 57 33 43 2f 2f 44 |UBLIC "-|//W3C//D|
|00000020| 54 44 20 48 54 4d 4c 20 | 33 2e 32 20 46 69 6e 61 |TD HTML |3.2 Fina|
|00000030| 6c 2f 2f 65 6e 22 3e 0a | 0a 3c 21 2d 2d 43 6f 6e |l//en">.|.<!--Con|
|00000040| 76 65 72 74 65 64 20 77 | 69 74 68 20 4c 61 54 65 |verted w|ith LaTe|
|00000050| 58 32 48 54 4d 4c 20 32 | 30 32 32 20 28 52 65 6c |X2HTML 2|022 (Rel|
|00000060| 65 61 73 65 64 20 4a 61 | 6e 75 61 72 79 20 31 2c |eased Ja|nuary 1,|
|00000070| 20 32 30 32 32 29 20 2d | 2d 3e 0a 3c 48 54 4d 4c | 2022) -|->.<HTML|
|00000080| 20 6c 61 6e 67 3d 22 65 | 6e 22 3e 0a 3c 48 45 41 | lang="e|n">.<HEA|
|00000090| 44 3e 0a 3c 54 49 54 4c | 45 3e 43 6f 6e 74 65 6e |D>.<TITL|E>Conten|
|000000a0| 74 73 20 6f 66 20 33 2d | 44 20 50 6c 6f 74 74 69 |ts of 3-|D Plotti|
|000000b0| 6e 67 3c 2f 54 49 54 4c | 45 3e 0a 0a 3c 4d 45 54 |ng</TITL|E>..<MET|
|000000c0| 41 20 48 54 54 50 2d 45 | 51 55 49 56 3d 22 43 6f |A HTTP-E|QUIV="Co|
|000000d0| 6e 74 65 6e 74 2d 54 79 | 70 65 22 20 43 4f 4e 54 |ntent-Ty|pe" CONT|
|000000e0| 45 4e 54 3d 22 74 65 78 | 74 2f 68 74 6d 6c 3b 20 |ENT="tex|t/html; |
|000000f0| 63 68 61 72 73 65 74 3d | 75 74 66 2d 38 22 3e 0a |charset=|utf-8">.|
|00000100| 3c 4d 45 54 41 20 4e 41 | 4d 45 3d 22 76 69 65 77 |<META NA|ME="view|
|00000110| 70 6f 72 74 22 20 43 4f | 4e 54 45 4e 54 3d 22 77 |port" CO|NTENT="w|
|00000120| 69 64 74 68 3d 64 65 76 | 69 63 65 2d 77 69 64 74 |idth=dev|ice-widt|
|00000130| 68 2c 20 69 6e 69 74 69 | 61 6c 2d 73 63 61 6c 65 |h, initi|al-scale|
|00000140| 3d 31 2e 30 22 3e 0a 3c | 4d 45 54 41 20 4e 41 4d |=1.0">.<|META NAM|
|00000150| 45 3d 22 47 65 6e 65 72 | 61 74 6f 72 22 20 43 4f |E="Gener|ator" CO|
|00000160| 4e 54 45 4e 54 3d 22 4c | 61 54 65 58 32 48 54 4d |NTENT="L|aTeX2HTM|
|00000170| 4c 20 76 32 30 32 32 22 | 3e 0a 0a 3c 4c 49 4e 4b |L v2022"|>..<LINK|
|00000180| 20 52 45 4c 3d 22 53 54 | 59 4c 45 53 48 45 45 54 | REL="ST|YLESHEET|
|00000190| 22 20 48 52 45 46 3d 22 | 72 6c 61 62 70 5f 74 65 |" HREF="|rlabp_te|
|000001a0| 78 2e 63 73 73 22 3e 0a | 0a 3c 4c 49 4e 4b 20 52 |x.css">.|.<LINK R|
|000001b0| 45 4c 3d 22 70 72 65 76 | 69 6f 75 73 22 20 48 52 |EL="prev|ious" HR|
|000001c0| 45 46 3d 22 6e 6f 64 65 | 34 39 5f 6d 6e 2e 68 74 |EF="node|49_mn.ht|
|000001d0| 6d 6c 22 3e 0a 3c 4c 49 | 4e 4b 20 52 45 4c 3d 22 |ml">.<LI|NK REL="|
|000001e0| 75 70 22 20 48 52 45 46 | 3d 22 6e 6f 64 65 34 37 |up" HREF|="node47|
|000001f0| 5f 6d 6e 2e 68 74 6d 6c | 22 3e 0a 3c 4c 49 4e 4b |_mn.html|">.<LINK|
|00000200| 20 52 45 4c 3d 22 6e 65 | 78 74 22 20 48 52 45 46 | REL="ne|xt" HREF|
|00000210| 3d 22 6e 6f 64 65 35 31 | 5f 6d 6e 2e 68 74 6d 6c |="node51|_mn.html|
|00000220| 22 3e 0a 3c 2f 48 45 41 | 44 3e 0a 20 0a 3c 42 4f |">.</HEA|D>. .<BO|
|00000230| 44 59 20 62 67 63 6f 6c | 6f 72 3d 22 23 66 66 66 |DY bgcol|or="#fff|
|00000240| 66 66 66 22 20 74 65 78 | 74 3d 22 23 30 30 30 30 |fff" tex|t="#0000|
|00000250| 30 30 22 20 6c 69 6e 6b | 3d 22 23 39 39 34 34 45 |00" link|="#9944E|
|00000260| 45 22 20 76 6c 69 6e 6b | 3d 22 23 30 30 30 30 66 |E" vlink|="#0000f|
|00000270| 66 22 20 61 6c 69 6e 6b | 3d 22 23 30 30 66 66 30 |f" alink|="#00ff0|
|00000280| 30 22 3e 0a 0a 3c 48 32 | 3e 3c 41 20 49 44 3d 22 |0">..<H2|><A ID="|
|00000290| 53 45 43 54 49 4f 4e 30 | 30 30 31 32 33 30 30 30 |SECTION0|00123000|
|000002a0| 30 30 30 30 30 30 30 30 | 30 30 30 30 22 3e 0a 33 |00000000|0000">.3|
|000002b0| 2d 44 20 50 6c 6f 74 74 | 69 6e 67 3c 2f 41 3e 0a |-D Plott|ing</A>.|
|000002c0| 3c 2f 48 32 3e 0a 0a 3c | 50 3e 0a 50 6c 6f 74 74 |</H2>..<|P>.Plott|
|000002d0| 69 6e 67 20 33 2d 64 69 | 6d 65 6e 73 69 6f 6e 61 |ing 3-di|mensiona|
|000002e0| 6c 20 64 61 74 61 20 69 | 73 20 71 75 69 74 65 20 |l data i|s quite |
|000002f0| 73 74 72 61 69 67 68 74 | 66 6f 72 77 61 72 64 2c |straight|forward,|
|00000300| 20 61 6e 64 20 76 65 72 | 79 0a 20 20 20 73 69 6d | and ver|y. sim|
|00000310| 69 6c 61 72 20 74 6f 20 | 74 68 65 20 73 74 65 70 |ilar to |the step|
|00000320| 73 20 75 73 65 64 20 66 | 6f 72 20 70 6c 6f 74 74 |s used f|or plott|
|00000330| 69 6e 67 20 32 2d 64 69 | 6d 65 6e 73 69 6f 6e 61 |ing 2-di|mensiona|
|00000340| 6c 20 64 61 74 61 2e 20 | 57 65 20 77 69 6c 6c 0a |l data. |We will.|
|00000350| 20 20 20 62 65 67 69 6e | 20 77 69 74 68 20 61 6e | begin| with an|
|00000360| 20 65 78 61 6d 70 6c 65 | 3a 0a 0a 3c 50 3e 0a 3c | example|:..<P>.<|
|00000370| 50 52 45 3e 0a 26 67 74 | 3b 20 2f 2f 20 43 72 65 |PRE>.&gt|; // Cre|
|00000380| 61 74 65 20 74 68 65 20 | 64 61 74 61 0a 26 67 74 |ate the |data.&gt|
|00000390| 3b 20 58 20 3d 20 2d 32 | 3a 32 3a 2e 32 3b 0a 26 |; X = -2|:2:.2;.&|
|000003a0| 67 74 3b 20 59 20 3d 20 | 58 3b 0a 26 67 74 3b 20 |gt; Y = |X;.&gt; |
|000003b0| 5a 20 3d 20 5b 5d 3b 0a | 26 67 74 3b 20 66 6f 72 |Z = [];.|&gt; for|
|000003c0| 20 28 69 20 69 6e 20 31 | 3a 58 2e 6e 29 20 7b 20 | (i in 1|:X.n) { |
|000003d0| 0a 26 67 74 3b 20 20 20 | 66 6f 72 20 28 6a 20 69 |.&gt; |for (j i|
|000003e0| 6e 20 31 3a 59 2e 6e 29 | 20 7b 20 0a 26 67 74 3b |n 1:Y.n)| { .&gt;|
|000003f0| 20 20 20 20 20 5a 5b 69 | 3b 6a 5d 20 3d 20 58 5b | Z[i|;j] = X[|
|00000400| 69 5d 20 2a 20 65 78 70 | 20 28 2d 58 5b 69 5d 5e |i] * exp| (-X[i]^|
|00000410| 32 20 2d 20 59 5b 6a 5d | 5e 32 29 3b 0a 26 67 74 |2 - Y[j]|^2);.&gt|
|00000420| 3b 20 20 20 7d 0a 26 67 | 74 3b 20 7d 0a 26 67 74 |; }.&g|t; }.&gt|
|00000430| 3b 20 2f 2f 20 4d 61 6b | 65 20 74 68 65 20 70 6c |; // Mak|e the pl|
|00000440| 6f 74 0a 26 67 74 3b 20 | 70 73 74 61 72 74 28 2c |ot.&gt; |pstart(,|
|00000450| 2c 22 78 77 69 6e 22 29 | 3b 0a 26 67 74 3b 20 70 |,"xwin")|;.&gt; p|
|00000460| 6c 77 69 64 28 34 29 3b | 0a 26 67 74 3b 20 70 74 |lwid(4);|.&gt; pt|
|00000470| 69 74 6c 65 28 22 53 61 | 6d 70 6c 65 20 33 2d 44 |itle("Sa|mple 3-D|
|00000480| 20 50 6c 6f 74 22 29 3b | 0a 26 67 74 3b 20 78 6c | Plot");|.&gt; xl|
|00000490| 61 62 65 6c 28 22 58 2d | 41 78 69 73 22 29 3b 0a |abel("X-|Axis");.|
|000004a0| 26 67 74 3b 20 79 6c 61 | 62 65 6c 28 22 59 2d 41 |&gt; yla|bel("Y-A|
|000004b0| 78 69 73 22 29 3b 0a 26 | 67 74 3b 20 7a 6c 61 62 |xis");.&|gt; zlab|
|000004c0| 65 6c 28 22 5a 2d 41 78 | 69 73 22 29 3b 0a 26 67 |el("Z-Ax|is");.&g|
|000004d0| 74 3b 20 70 6c 6d 65 73 | 68 28 20 26 6c 74 3b 26 |t; plmes|h( &lt;&|
|000004e0| 6c 74 3b 20 78 20 3d 20 | 58 3b 20 79 20 3d 20 59 |lt; x = |X; y = Y|
|000004f0| 3b 20 7a 20 3d 20 5a 20 | 26 67 74 3b 26 67 74 3b |; z = Z |&gt;&gt;|
|00000500| 20 29 3b 0a 26 67 74 3b | 20 70 6c 70 72 69 6e 74 | );.&gt;| plprint|
|00000510| 28 22 33 64 2e 70 73 22 | 29 3b 0a 3c 2f 50 52 45 |("3d.ps"|);.</PRE|
|00000520| 3e 0a 0a 3c 50 3e 0a 0a | 3c 44 49 56 20 63 6c 61 |>..<P>..|<DIV cla|
|00000530| 73 73 3d 22 43 45 4e 54 | 45 52 22 3e 3c 41 20 49 |ss="CENT|ER"><A I|
|00000540| 44 3d 22 70 33 64 22 3e | 3c 2f 41 3e 3c 41 20 49 |D="p3d">|</A><A I|
|00000550| 44 3d 22 35 30 39 22 3e | 3c 2f 41 3e 0a 3c 54 41 |D="509">|</A>.<TA|
|00000560| 42 4c 45 3e 0a 3c 43 41 | 50 54 49 4f 4e 20 63 6c |BLE>.<CA|PTION cl|
|00000570| 61 73 73 3d 22 42 4f 54 | 54 4f 4d 22 3e 3c 53 54 |ass="BOT|TOM"><ST|
|00000580| 52 4f 4e 47 3e 46 69 67 | 75 72 65 3a 3c 2f 53 54 |RONG>Fig|ure:</ST|
|00000590| 52 4f 4e 47 3e 0a 45 78 | 61 6d 70 6c 65 20 33 44 |RONG>.Ex|ample 3D|
|000005a0| 20 50 6c 6f 74 3c 2f 43 | 41 50 54 49 4f 4e 3e 0a | Plot</C|APTION>.|
|000005b0| 3c 54 52 3e 3c 54 44 3e | 3c 49 4d 47 0a 20 53 54 |<TR><TD>|<IMG. ST|
|000005c0| 59 4c 45 3d 22 68 65 69 | 67 68 74 3a 20 32 38 36 |YLE="hei|ght: 286|
|000005d0| 2e 37 36 65 78 3b 20 22 | 20 53 52 43 3d 22 69 6d |.76ex; "| SRC="im|
|000005e0| 67 39 2e 70 6e 67 22 0a | 20 41 4c 54 3d 22 5c 62 |g9.png".| ALT="\b|
|000005f0| 65 67 69 6e 7b 66 69 67 | 75 72 65 7d 5c 62 65 67 |egin{fig|ure}\beg|
|00000600| 69 6e 7b 70 69 63 74 75 | 72 65 7d 28 33 30 30 2c |in{pictu|re}(300,|
|00000610| 33 35 30 29 28 30 2c 31 | 32 30 29 20 25 20 28 78 |350)(0,1|20) % (x|
|00000620| 2d 73 69 7a 65 2c 20 79 | 2d 73 69 7a 65 29 20 28 |-size, y|-size) (|
|00000630| 78 2d 73 68 69 66 74 2c | 20 79 2d 73 68 69 2e 2e |x-shift,| y-shi..|
|00000640| 2e 0a 2e 2e 2e 61 6e 67 | 6c 65 3d 39 30 20 68 73 |.....ang|le=90 hs|
|00000650| 63 61 6c 65 3d 38 30 20 | 76 73 63 61 6c 65 3d 38 |cale=80 |vscale=8|
|00000660| 30 20 76 6f 66 66 73 65 | 74 3d 34 30 20 68 6f 66 |0 voffse|t=40 hof|
|00000670| 66 73 65 74 3d 35 33 30 | 7d 0a 5c 65 6e 64 7b 70 |fset=530|}.\end{p|
|00000680| 69 63 74 75 72 65 7d 0a | 5c 65 6e 64 7b 66 69 67 |icture}.|\end{fig|
|00000690| 75 72 65 7d 22 3e 3c 2f | 54 44 3e 3c 2f 54 52 3e |ure}"></|TD></TR>|
|000006a0| 0a 3c 2f 54 41 42 4c 45 | 3e 0a 3c 2f 44 49 56 3e |.</TABLE|>.</DIV>|
|000006b0| 0a 0a 3c 50 3e 0a 54 68 | 65 20 6f 75 74 70 75 74 |..<P>.Th|e output|
|000006c0| 20 66 72 6f 6d 20 74 68 | 65 20 70 6c 70 72 69 6e | from th|e plprin|
|000006d0| 74 20 63 6f 6d 6d 61 6e | 64 20 61 70 70 65 61 72 |t comman|d appear|
|000006e0| 73 20 69 6e 0a 20 20 20 | 46 69 67 75 72 65 26 6e |s in. |Figure&n|
|000006f0| 62 73 70 3b 3c 41 20 48 | 52 45 46 3d 22 6e 6f 64 |bsp;<A H|REF="nod|
|00000700| 65 35 30 5f 63 74 2e 68 | 74 6d 6c 23 70 33 64 22 |e50_ct.h|tml#p3d"|
|00000710| 3e 3c 49 4d 47 20 20 41 | 4c 54 3d 22 5b 2a 5d 22 |><IMG A|LT="[*]"|
|00000720| 20 53 52 43 3d 22 63 72 | 6f 73 73 72 65 66 2e 70 | SRC="cr|ossref.p|
|00000730| 6e 67 22 3e 3c 2f 41 3e | 2e 20 4e 6f 77 20 77 65 |ng"></A>|. Now we|
|00000740| 20 6d 75 73 74 20 74 61 | 6b 65 20 61 20 6d 69 6e | must ta|ke a min|
|00000750| 75 74 65 20 61 6e 64 20 | 65 78 70 6c 61 69 6e 20 |ute and |explain |
|00000760| 74 68 65 20 64 61 74 61 | 0a 20 20 20 70 61 73 73 |the data|. pass|
|00000770| 65 64 20 61 73 20 69 6e | 70 75 74 20 74 6f 20 3c |ed as in|put to <|
|00000780| 63 6f 64 65 3e 70 6c 6f | 74 33 3c 2f 63 6f 64 65 |code>plo|t3</code|
|00000790| 3e 2e 20 54 68 72 65 65 | 20 64 69 6d 65 6e 73 69 |>. Three| dimensi|
|000007a0| 6f 6e 61 6c 20 70 6c 6f | 74 73 20 68 61 76 65 20 |onal plo|ts have |
|000007b0| 74 77 6f 0a 20 20 20 69 | 6e 64 65 70 65 6e 64 65 |two. i|ndepende|
|000007c0| 6e 74 20 76 61 72 69 61 | 62 6c 65 73 20 28 76 65 |nt varia|bles (ve|
|000007d0| 63 74 6f 72 73 29 2c 20 | 3c 63 6f 64 65 3e 78 3c |ctors), |<code>x<|
|000007e0| 2f 63 6f 64 65 3e 2c 20 | 61 6e 64 20 3c 63 6f 64 |/code>, |and <cod|
|000007f0| 65 3e 79 3c 2f 63 6f 64 | 65 3e 2e 20 54 68 65 0a |e>y</cod|e>. The.|
|00000800| 20 20 20 64 65 70 65 6e | 64 65 6e 74 20 76 61 72 | depen|dent var|
|00000810| 69 61 62 6c 65 20 3c 63 | 6f 64 65 3e 7a 3c 2f 63 |iable <c|ode>z</c|
|00000820| 6f 64 65 3e 20 28 61 20 | 6d 61 74 72 69 78 29 20 |ode> (a |matrix) |
|00000830| 69 73 20 61 20 66 75 6e | 63 74 69 6f 6e 20 6f 66 |is a fun|ction of|
|00000840| 20 62 6f 74 68 0a 20 20 | 20 3c 63 6f 64 65 3e 78 | both. | <code>x|
|00000850| 3c 2f 63 6f 64 65 3e 20 | 61 6e 64 20 3c 63 6f 64 |</code> |and <cod|
|00000860| 65 3e 79 3c 2f 63 6f 64 | 65 3e 20 61 6e 64 20 68 |e>y</cod|e> and h|
|00000870| 61 73 20 72 6f 77 20 64 | 69 6d 65 6e 73 69 6f 6e |as row d|imension|
|00000880| 20 74 68 65 20 6c 65 6e | 67 74 68 20 6f 66 20 3c | the len|gth of <|
|00000890| 63 6f 64 65 3e 78 3c 2f | 63 6f 64 65 3e 0a 20 20 |code>x</|code>. |
|000008a0| 20 61 6e 64 20 63 6f 6c | 75 6d 6e 20 64 69 6d 65 | and col|umn dime|
|000008b0| 6e 73 69 6f 6e 20 74 68 | 65 20 6c 65 6e 67 74 68 |nsion th|e length|
|000008c0| 20 3c 63 6f 64 65 3e 79 | 3c 2f 63 6f 64 65 3e 2e | <code>y|</code>.|
|000008d0| 20 54 68 69 73 20 73 74 | 6f 72 61 67 65 20 73 63 | This st|orage sc|
|000008e0| 68 65 6d 65 20 66 6f 72 | 0a 20 20 20 74 68 72 65 |heme for|. thre|
|000008f0| 65 2d 64 69 6d 65 6e 73 | 69 6f 6e 61 6c 20 64 61 |e-dimens|ional da|
|00000900| 74 61 20 69 73 20 65 63 | 6f 6e 6f 6d 69 63 61 6c |ta is ec|onomical|
|00000910| 20 69 6e 20 74 65 72 6d | 73 20 6f 66 20 6d 65 6d | in term|s of mem|
|00000920| 6f 72 79 2c 20 61 6e 64 | 20 61 6c 6c 6f 77 73 0a |ory, and| allows.|
|00000930| 20 20 20 74 68 65 20 75 | 73 65 72 20 73 6f 6d 65 | the u|ser some|
|00000940| 20 65 78 74 72 61 20 66 | 6c 65 78 69 62 69 6c 69 | extra f|lexibili|
|00000950| 74 79 2e 20 54 68 75 73 | 2c 20 74 68 65 20 61 72 |ty. Thus|, the ar|
|00000960| 67 75 6d 65 6e 74 20 74 | 6f 20 3c 63 6f 64 65 3e |gument t|o <code>|
|00000970| 70 6c 6f 74 33 3c 2f 63 | 6f 64 65 3e 0a 20 20 20 |plot3</c|ode>. |
|00000980| 69 73 20 61 20 6c 69 73 | 74 20 77 69 74 68 20 74 |is a lis|t with t|
|00000990| 68 72 65 65 20 65 6c 65 | 6d 65 6e 74 73 3a 20 3c |hree ele|ments: <|
|000009a0| 63 6f 64 65 3e 78 3c 2f | 63 6f 64 65 3e 2c 20 3c |code>x</|code>, <|
|000009b0| 63 6f 64 65 3e 79 3c 2f | 63 6f 64 65 3e 2c 20 61 |code>y</|code>, a|
|000009c0| 6e 64 0a 20 20 20 3c 63 | 6f 64 65 3e 7a 3c 2f 63 |nd. <c|ode>z</c|
|000009d0| 6f 64 65 3e 2e 20 3c 63 | 6f 64 65 3e 70 6c 6f 74 |ode>. <c|ode>plot|
|000009e0| 33 3c 2f 63 6f 64 65 3e | 20 63 61 6e 20 61 63 63 |3</code>| can acc|
|000009f0| 65 70 74 20 75 70 20 74 | 6f 20 74 68 72 65 65 20 |ept up t|o three |
|00000a00| 64 69 73 74 69 6e 63 74 | 20 6c 69 73 74 73 20 66 |distinct| lists f|
|00000a10| 6f 72 0a 20 20 20 70 6c | 6f 74 74 69 6e 67 2e 0a |or. pl|otting..|
|00000a20| 0a 3c 50 3e 0a 54 68 65 | 20 73 61 6d 65 20 70 6c |.<P>.The| same pl|
|00000a30| 6f 74 2d 66 75 6e 63 74 | 69 6f 6e 73 3a 20 3c 63 |ot-funct|ions: <c|
|00000a40| 6f 64 65 3e 70 74 69 74 | 6c 65 3c 2f 63 6f 64 65 |ode>ptit|le</code|
|00000a50| 3e 2c 20 3c 63 6f 64 65 | 3e 78 6c 61 62 65 6c 3c |>, <code|>xlabel<|
|00000a60| 2f 63 6f 64 65 3e 2c 20 | 61 6e 64 0a 20 20 20 3c |/code>, |and. <|
|00000a70| 63 6f 64 65 3e 79 6c 61 | 62 65 6c 3c 2f 63 6f 64 |code>yla|bel</cod|
|00000a80| 65 3e 20 63 61 6e 20 62 | 65 20 75 73 65 64 20 77 |e> can b|e used w|
|00000a90| 69 74 68 20 33 2d 64 69 | 6d 65 6e 73 69 6f 6e 61 |ith 3-di|mensiona|
|00000aa0| 6c 20 70 6c 6f 74 73 2e | 20 41 64 64 69 74 69 6f |l plots.| Additio|
|00000ab0| 6e 61 6c 6c 79 2c 0a 20 | 20 20 3c 63 6f 64 65 3e |nally,. | <code>|
|00000ac0| 7a 6c 61 62 65 6c 3c 2f | 63 6f 64 65 3e 20 63 61 |zlabel</|code> ca|
|00000ad0| 6e 20 62 65 20 75 73 65 | 64 20 74 6f 20 61 64 64 |n be use|d to add|
|00000ae0| 20 6c 61 62 65 6c 73 20 | 74 6f 20 74 68 65 20 3c | labels |to the <|
|00000af0| 63 6f 64 65 3e 7a 3c 2f | 63 6f 64 65 3e 20 61 78 |code>z</|code> ax|
|00000b00| 69 73 2e 0a 0a 3c 50 3e | 0a 54 68 65 20 6e 65 78 |is...<P>|.The nex|
|00000b10| 74 20 65 78 61 6d 70 6c | 65 20 28 46 69 67 75 72 |t exampl|e (Figur|
|00000b20| 65 26 6e 62 73 70 3b 3c | 41 20 48 52 45 46 3d 22 |e&nbsp;<|A HREF="|
|00000b30| 6e 6f 64 65 35 30 5f 63 | 74 2e 68 74 6d 6c 23 70 |node50_c|t.html#p|
|00000b40| 36 22 3e 3c 49 4d 47 20 | 20 41 4c 54 3d 22 5b 2a |6"><IMG | ALT="[*|
|00000b50| 5d 22 20 53 52 43 3d 22 | 63 72 6f 73 73 72 65 66 |]" SRC="|crossref|
|00000b60| 2e 70 6e 67 22 3e 3c 2f | 41 3e 29 20 64 65 6d 6f |.png"></|A>) demo|
|00000b70| 6e 73 74 72 61 74 65 73 | 20 6d 6f 72 65 20 70 6c |nstrates| more pl|
|00000b80| 6f 74 74 69 6e 67 0a 20 | 20 20 63 61 70 61 62 69 |otting. | capabi|
|00000b90| 6c 69 74 69 65 73 20 2d | 20 69 6e 63 6c 75 64 69 |lities -| includi|
|00000ba0| 6e 67 3a 20 63 68 61 6e | 67 69 6e 67 20 66 6f 6e |ng: chan|ging fon|
|00000bb0| 74 73 20 61 6e 64 20 70 | 65 6e 20 77 69 64 74 68 |ts and p|en width|
|00000bc0| 73 2c 20 6d 75 6c 74 69 | 70 6c 65 0a 20 20 20 70 |s, multi|ple. p|
|00000bd0| 6c 6f 74 73 20 70 65 72 | 20 70 61 67 65 20 61 6e |lots per| page an|
|00000be0| 64 20 61 6e 6e 6f 74 61 | 74 69 6e 67 20 61 20 70 |d annota|ting a p|
|00000bf0| 6c 6f 74 2e 20 4e 6f 74 | 65 20 74 68 61 74 20 74 |lot. Not|e that t|
|00000c00| 68 65 20 63 61 6c 6c 73 | 20 74 6f 0a 20 20 20 3c |he calls| to. <|
|00000c10| 63 6f 64 65 3e 70 6c 70 | 74 65 78 3c 2f 63 6f 64 |code>plp|tex</cod|
|00000c20| 65 3e 20 61 72 65 20 6d | 61 64 65 20 3c 45 4d 3e |e> are m|ade <EM>|
|00000c30| 61 66 74 65 72 3c 2f 45 | 4d 3e 20 74 68 65 20 3c |after</E|M> the <|
|00000c40| 63 6f 64 65 3e 70 6c 6f | 74 3c 2f 63 6f 64 65 3e |code>plo|t</code>|
|00000c50| 20 63 61 6c 6c 73 2e 20 | 73 69 6e 63 65 0a 20 20 | calls. |since. |
|00000c60| 20 3c 63 6f 64 65 3e 70 | 6c 70 74 65 78 3c 2f 63 | <code>p|lptex</c|
|00000c70| 6f 64 65 3e 20 75 73 65 | 73 20 74 68 65 20 70 6c |ode> use|s the pl|
|00000c80| 6f 74 20 63 6f 6f 72 64 | 69 6e 61 74 65 73 20 74 |ot coord|inates t|
|00000c90| 6f 20 70 6c 61 63 65 20 | 74 65 78 74 20 6f 6e 20 |o place |text on |
|00000ca0| 74 68 65 20 67 72 61 70 | 68 2c 0a 20 20 20 74 68 |the grap|h,. th|
|00000cb0| 65 20 70 6c 6f 74 20 6d | 75 73 74 20 62 65 20 63 |e plot m|ust be c|
|00000cc0| 72 65 61 74 65 64 20 66 | 69 72 73 74 2e 0a 0a 3c |reated f|irst...<|
|00000cd0| 50 3e 0a 3c 50 52 45 3e | 0a 2f 2f 0a 2f 2f 20 44 |P>.<PRE>|.//.// D|
|00000ce0| 65 6d 6f 6e 73 74 72 61 | 74 65 20 74 68 65 20 65 |emonstra|te the e|
|00000cf0| 66 66 65 63 74 20 6f 66 | 20 61 64 64 69 6e 67 20 |ffect of| adding |
|00000d00| 74 65 72 6d 73 20 74 6f | 20 61 20 46 6f 75 72 69 |terms to| a Fouri|
|00000d10| 65 72 20 65 78 70 61 6e | 73 69 6f 6e 0a 2f 2f 0a |er expan|sion.//.|
|00000d20| 0a 2f 2f 20 57 65 20 77 | 61 6e 74 20 74 6f 20 61 |.// We w|ant to a|
|00000d30| 70 70 72 6f 78 69 6d 61 | 74 65 20 61 20 73 71 75 |pproxima|te a squ|
|00000d40| 61 72 65 20 77 61 76 65 | 2e 2e 2e 0a 2f 2f 20 54 |are wave|....// T|
|00000d50| 68 65 20 46 6f 75 72 69 | 65 72 20 53 65 72 69 65 |he Fouri|er Serie|
|00000d60| 73 20 66 6f 72 20 61 20 | 73 71 75 61 72 65 20 77 |s for a |square w|
|00000d70| 61 76 65 20 69 73 20 61 | 20 0a 2f 2f 20 73 75 6d |ave is a| .// sum|
|00000d80| 20 6f 66 20 6f 64 64 20 | 68 61 72 6d 6f 6e 69 63 | of odd |harmonic|
|00000d90| 73 20 2d 20 77 65 20 77 | 69 6c 6c 20 64 65 6d 6f |s - we w|ill demo|
|00000da0| 6e 73 74 72 61 74 65 2e | 0a 2f 2f 20 53 74 61 72 |nstrate.|.// Star|
|00000db0| 74 20 75 70 20 61 20 70 | 6c 6f 74 20 77 69 6e 64 |t up a p|lot wind|
|00000dc0| 6f 77 2e 2e 2e 0a 0a 70 | 73 74 61 72 74 28 32 2c |ow.....p|start(2,|
|00000dd0| 32 2c 20 22 78 77 69 6e | 22 29 3b 0a 0a 2f 2f 20 |2, "xwin|");..// |
|00000de0| 43 6f 6d 70 75 74 65 20 | 74 68 65 20 31 73 74 20 |Compute |the 1st |
|00000df0| 74 65 72 6d 20 69 6e 20 | 74 68 65 20 46 6f 75 72 |term in |the Four|
|00000e00| 69 65 72 20 73 65 72 69 | 65 73 20 61 6e 64 20 70 |ier seri|es and p|
|00000e10| 6c 6f 74 2e 0a 0a 74 20 | 3d 20 28 30 3a 31 30 3a |lot...t |= (0:10:|
|00000e20| 2e 31 29 27 3b 0a 79 20 | 3d 20 73 69 6e 20 28 74 |.1)';.y |= sin (t|
|00000e30| 29 3b 0a 0a 70 74 69 74 | 6c 65 20 28 22 46 75 6e |);..ptit|le ("Fun|
|00000e40| 64 61 6d 65 6e 74 61 6c | 20 46 72 65 71 75 65 6e |damental| Frequen|
|00000e50| 63 79 22 29 3b 0a 70 6c | 77 69 64 28 31 30 29 3b |cy");.pl|wid(10);|
|00000e60| 0a 70 6c 66 6f 6e 74 28 | 31 29 3b 0a 70 6c 6f 74 |.plfont(|1);.plot|
|00000e70| 20 28 20 5b 74 2c 79 5d | 20 29 3b 0a 70 6c 70 74 | ( [t,y]| );.plpt|
|00000e80| 65 78 20 28 22 50 65 6e | 20 77 69 64 74 68 20 3d |ex ("Pen| width =|
|00000e90| 20 31 30 22 2c 20 34 2c | 20 30 2e 34 29 3b 0a 70 | 10", 4,| 0.4);.p|
|00000ea0| 6c 70 74 65 78 20 28 22 | 46 6f 6e 74 20 3d 20 31 |lptex ("|Font = 1|
|00000eb0| 20 28 4e 6f 72 6d 61 6c | 29 22 2c 20 34 2c 20 30 | (Normal|)", 4, 0|
|00000ec0| 2e 31 29 3b 0a 70 61 75 | 73 65 20 28 29 3b 0a 0a |.1);.pau|se ();..|
|00000ed0| 2f 2f 20 4e 6f 77 20 61 | 64 64 20 74 68 65 20 74 |// Now a|dd the t|
|00000ee0| 68 69 72 64 20 68 61 72 | 6d 6f 6e 69 63 20 74 6f |hird har|monic to|
|00000ef0| 20 74 68 65 20 66 75 6e | 64 61 6d 65 6e 74 61 6c | the fun|damental|
|00000f00| 2c 20 61 6e 64 20 70 6c | 6f 74 2e 0a 0a 79 20 3d |, and pl|ot...y =|
|00000f10| 20 73 69 6e 20 28 74 29 | 20 2b 20 73 69 6e 20 28 | sin (t)| + sin (|
|00000f20| 33 2a 74 29 2f 33 3b 0a | 0a 70 74 69 74 6c 65 20 |3*t)/3;.|.ptitle |
|00000f30| 28 22 31 73 74 20 61 6e | 64 20 33 72 64 20 48 61 |("1st an|d 3rd Ha|
|00000f40| 72 6d 6f 6e 69 63 73 22 | 29 3b 0a 70 6c 77 69 64 |rmonics"|);.plwid|
|00000f50| 28 37 29 3b 0a 70 6c 66 | 6f 6e 74 28 34 29 3b 0a |(7);.plf|ont(4);.|
|00000f60| 70 6c 6f 74 20 28 20 5b | 74 2c 79 5d 20 29 3b 0a |plot ( [|t,y] );.|
|00000f70| 70 6c 70 74 65 78 20 28 | 22 50 65 6e 20 77 69 64 |plptex (|"Pen wid|
|00000f80| 74 68 20 3d 20 37 22 2c | 20 34 2c 20 30 2e 34 29 |th = 7",| 4, 0.4)|
|00000f90| 3b 0a 70 6c 70 74 65 78 | 20 28 22 46 6f 6e 74 20 |;.plptex| ("Font |
|00000fa0| 3d 20 34 20 28 53 63 72 | 69 70 74 29 22 2c 20 34 |= 4 (Scr|ipt)", 4|
|00000fb0| 2c 20 30 2e 31 29 3b 0a | 70 61 75 73 65 20 28 29 |, 0.1);.|pause ()|
|00000fc0| 3b 0a 0a 2f 2f 20 4e 6f | 77 20 75 73 65 20 74 68 |;..// No|w use th|
|00000fd0| 65 20 66 69 72 73 74 2c | 20 74 68 69 72 64 2c 20 |e first,| third, |
|00000fe0| 66 69 66 74 68 2c 20 73 | 65 76 65 6e 74 68 2c 20 |fifth, s|eventh, |
|00000ff0| 61 6e 64 20 6e 69 6e 74 | 68 20 68 61 72 6d 6f 6e |and nint|h harmon|
|00001000| 69 63 73 2e 0a 0a 79 20 | 3d 20 73 69 6e 20 28 74 |ics...y |= sin (t|
|00001010| 29 20 2b 20 73 69 6e 20 | 28 33 2a 74 29 2f 33 20 |) + sin |(3*t)/3 |
|00001020| 2b 20 73 69 6e 20 28 35 | 2a 74 29 2f 35 20 2b 20 |+ sin (5|*t)/5 + |
|00001030| 73 69 6e 20 28 37 2a 74 | 29 2f 37 20 2b 20 73 69 |sin (7*t|)/7 + si|
|00001040| 6e 20 28 39 2a 74 29 2f | 39 3b 0a 70 74 69 74 6c |n (9*t)/|9;.ptitl|
|00001050| 65 20 28 22 31 73 74 2c | 20 33 72 64 2c 20 35 74 |e ("1st,| 3rd, 5t|
|00001060| 68 2c 20 37 74 68 2c 20 | 39 74 68 20 48 61 72 6d |h, 7th, |9th Harm|
|00001070| 6f 6e 69 63 73 22 29 3b | 0a 70 6c 77 69 64 28 34 |onics");|.plwid(4|
|00001080| 29 3b 0a 70 6c 66 6f 6e | 74 28 33 29 3b 0a 70 6c |);.plfon|t(3);.pl|
|00001090| 6f 74 20 28 20 5b 74 2c | 79 5d 20 29 3b 20 0a 70 |ot ( [t,|y] ); .p|
|000010a0| 6c 70 74 65 78 20 28 22 | 50 65 6e 20 77 69 64 74 |lptex ("|Pen widt|
|000010b0| 68 20 3d 20 33 22 2c 20 | 34 2c 20 30 2e 34 29 3b |h = 3", |4, 0.4);|
|000010c0| 0a 70 6c 70 74 65 78 20 | 28 22 46 6f 6e 74 20 3d |.plptex |("Font =|
|000010d0| 20 33 20 28 49 74 61 6c | 69 63 29 22 2c 20 34 2c | 3 (Ital|ic)", 4,|
|000010e0| 20 30 2e 31 29 3b 0a 70 | 61 75 73 65 20 28 29 3b | 0.1);.p|ause ();|
|000010f0| 0a 0a 2f 2f 0a 2f 2f 20 | 4e 6f 77 20 63 72 65 61 |..//.// |Now crea|
|00001100| 74 65 20 61 20 6d 61 74 | 72 69 78 20 77 69 74 68 |te a mat|rix with|
|00001110| 20 72 6f 77 73 20 74 68 | 61 74 20 72 65 70 72 65 | rows th|at repre|
|00001120| 73 65 6e 74 20 61 64 64 | 69 6e 67 0a 2f 2f 20 6d |sent add|ing.// m|
|00001130| 6f 72 65 20 61 6e 64 20 | 6d 6f 72 65 20 74 65 72 |ore and |more ter|
|00001140| 6d 73 20 74 6f 20 74 68 | 65 20 73 65 72 69 65 73 |ms to th|e series|
|00001150| 2e 0a 2f 2f 20 0a 0a 74 | 20 3d 20 28 30 3a 33 2e |..// ..t| = (0:3.|
|00001160| 31 34 3a 2e 30 32 29 3b | 0a 79 20 3d 20 7a 65 72 |14:.02);|.y = zer|
|00001170| 6f 73 28 31 30 2c 6d 61 | 78 28 73 69 7a 65 28 74 |os(10,ma|x(size(t|
|00001180| 29 29 29 3b 0a 78 20 3d | 20 7a 65 72 6f 73 28 73 |)));.x =| zeros(s|
|00001190| 69 7a 65 28 74 29 29 3b | 0a 0a 66 6f 72 20 28 6b |ize(t));|..for (k|
|000011a0| 20 69 6e 20 31 3a 31 39 | 3a 32 29 0a 7b 0a 20 20 | in 1:19|:2).{. |
|000011b0| 78 20 3d 20 78 20 2b 20 | 73 69 6e 28 6b 2a 74 29 |x = x + |sin(k*t)|
|000011c0| 2f 6b 3b 20 0a 20 20 79 | 5b 28 6b 2b 31 29 2f 32 |/k; . y|[(k+1)/2|
|000011d0| 3b 5d 20 3d 20 78 3b 0a | 7d 0a 0a 2f 2f 0a 2f 2f |;] = x;.|}..//.//|
|000011e0| 20 4e 6f 77 20 6d 61 6b | 65 20 61 20 6e 69 63 65 | Now mak|e a nice|
|000011f0| 20 33 2d 44 20 70 6c 6f | 74 20 74 68 61 74 20 73 | 3-D plo|t that s|
|00001200| 68 6f 77 73 20 74 68 65 | 20 65 66 66 65 63 74 0a |hows the| effect.|
|00001210| 2f 2f 20 6f 66 20 61 64 | 64 69 6e 67 20 6d 6f 72 |// of ad|ding mor|
|00001220| 65 20 61 6e 64 20 6d 6f | 72 65 20 74 65 72 6d 73 |e and mo|re terms|
|00001230| 20 74 6f 20 74 68 65 20 | 73 65 72 69 65 73 2e 0a | to the |series..|
|00001240| 2f 2f 0a 0a 70 6c 66 6f | 6e 74 20 28 32 29 3b 0a |//..plfo|nt (2);.|
|00001250| 70 6c 77 69 64 28 31 29 | 3b 0a 70 74 69 74 6c 65 |plwid(1)|;.ptitle|
|00001260| 20 28 22 53 71 75 61 72 | 65 20 57 61 76 65 20 76 | ("Squar|e Wave v|
|00001270| 69 61 20 46 6f 75 72 69 | 65 72 20 53 65 72 69 65 |ia Fouri|er Serie|
|00001280| 73 22 29 3b 0a 79 6c 61 | 62 65 6c 20 28 22 4e 6f |s");.yla|bel ("No|
|00001290| 2e 20 54 65 72 6d 73 22 | 29 3b 0a 70 6c 61 7a 20 |. Terms"|);.plaz |
|000012a0| 28 31 34 30 29 3b 0a 70 | 6c 6f 74 33 20 28 26 6c |(140);.p|lot3 (&l|
|000012b0| 74 3b 26 6c 74 3b 20 78 | 20 3d 20 74 3b 20 79 3d |t;&lt; x| = t; y=|
|000012c0| 31 3a 31 30 3b 20 7a 3d | 79 27 20 26 67 74 3b 26 |1:10; z=|y' &gt;&|
|000012d0| 67 74 3b 29 3b 0a 70 6c | 70 74 65 78 20 28 22 50 |gt;);.pl|ptex ("P|
|000012e0| 65 6e 20 77 69 64 74 68 | 20 3d 20 31 22 2c 20 2d |en width| = 1", -|
|000012f0| 31 2c 20 34 2e 35 29 3b | 0a 70 6c 70 74 65 78 20 |1, 4.5);|.plptex |
|00001300| 28 22 46 6f 6e 74 20 3d | 20 32 20 28 52 6f 6d 61 |("Font =| 2 (Roma|
|00001310| 6e 29 22 2c 20 2d 31 2c | 20 33 2e 38 29 3b 0a 70 |n)", -1,| 3.8);.p|
|00001320| 6c 70 72 69 6e 74 20 28 | 22 70 36 2e 70 73 22 29 |lprint (|"p6.ps")|
|00001330| 3b 09 2f 2f 20 4d 61 6b | 65 20 68 61 72 64 63 6f |;.// Mak|e hardco|
|00001340| 70 79 20 28 50 6f 73 74 | 73 63 72 69 70 74 20 64 |py (Post|script d|
|00001350| 65 66 61 75 6c 74 29 2e | 0a 3c 2f 50 52 45 3e 0a |efault).|.</PRE>.|
|00001360| 0a 3c 50 3e 0a 0a 3c 44 | 49 56 20 63 6c 61 73 73 |.<P>..<D|IV class|
|00001370| 3d 22 43 45 4e 54 45 52 | 22 3e 3c 41 20 49 44 3d |="CENTER|"><A ID=|
|00001380| 22 70 36 22 3e 3c 2f 41 | 3e 3c 41 20 49 44 3d 22 |"p6"></A|><A ID="|
|00001390| 35 31 30 22 3e 3c 2f 41 | 3e 0a 3c 54 41 42 4c 45 |510"></A|>.<TABLE|
|000013a0| 3e 0a 3c 43 41 50 54 49 | 4f 4e 20 63 6c 61 73 73 |>.<CAPTI|ON class|
|000013b0| 3d 22 42 4f 54 54 4f 4d | 22 3e 3c 53 54 52 4f 4e |="BOTTOM|"><STRON|
|000013c0| 47 3e 46 69 67 75 72 65 | 3a 3c 2f 53 54 52 4f 4e |G>Figure|:</STRON|
|000013d0| 47 3e 0a 53 71 75 61 72 | 65 20 57 61 76 65 20 50 |G>.Squar|e Wave P|
|000013e0| 6c 6f 74 20 45 78 61 6d | 70 6c 65 3c 2f 43 41 50 |lot Exam|ple</CAP|
|000013f0| 54 49 4f 4e 3e 0a 3c 54 | 52 3e 3c 54 44 3e 3c 49 |TION>.<T|R><TD><I|
|00001400| 4d 47 0a 20 53 54 59 4c | 45 3d 22 68 65 69 67 68 |MG. STYL|E="heigh|
|00001410| 74 3a 20 32 38 36 2e 37 | 36 65 78 3b 20 22 20 53 |t: 286.7|6ex; " S|
|00001420| 52 43 3d 22 69 6d 67 31 | 30 2e 70 6e 67 22 0a 20 |RC="img1|0.png". |
|00001430| 41 4c 54 3d 22 5c 62 65 | 67 69 6e 7b 66 69 67 75 |ALT="\be|gin{figu|
|00001440| 72 65 7d 5c 62 65 67 69 | 6e 7b 70 69 63 74 75 72 |re}\begi|n{pictur|
|00001450| 65 7d 28 35 30 30 2c 34 | 35 30 29 28 30 2c 35 30 |e}(500,4|50)(0,50|
|00001460| 29 20 25 20 28 78 2d 73 | 69 7a 65 2c 20 79 2d 73 |) % (x-s|ize, y-s|
|00001470| 69 7a 65 29 20 28 78 2d | 73 68 69 66 74 2c 20 79 |ize) (x-|shift, y|
|00001480| 2d 73 68 69 66 2e 2e 2e | 0a 2e 2e 2e 61 6e 67 6c |-shif...|....angl|
|00001490| 65 3d 39 30 20 68 73 63 | 61 6c 65 3d 37 30 20 76 |e=90 hsc|ale=70 v|
|000014a0| 73 63 61 6c 65 3d 38 30 | 20 76 6f 66 66 73 65 74 |scale=80| voffset|
|000014b0| 3d 34 30 20 68 6f 66 66 | 73 65 74 3d 35 30 30 7d |=40 hoff|set=500}|
|000014c0| 0a 5c 65 6e 64 7b 70 69 | 63 74 75 72 65 7d 0a 5c |.\end{pi|cture}.\|
|000014d0| 65 6e 64 7b 66 69 67 75 | 72 65 7d 22 3e 3c 2f 54 |end{figu|re}"></T|
|000014e0| 44 3e 3c 2f 54 52 3e 0a | 3c 2f 54 41 42 4c 45 3e |D></TR>.|</TABLE>|
|000014f0| 0a 3c 2f 44 49 56 3e 0a | 0a 3c 50 3e 0a 0a 3c 50 |.</DIV>.|.<P>..<P|
|00001500| 3e 0a 0a 3c 48 52 3e 0a | 0a 3c 2f 42 4f 44 59 3e |>..<HR>.|.</BODY>|
|00001510| 0a 3c 2f 48 54 4d 4c 3e | 0a |.</HTML>|. |
+--------+-------------------------+-------------------------+--------+--------+