File: matrix.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 (56 lines) | stat: -rw-r--r-- 1,944 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
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
!<HTML>
<HEAD>
<TITLE>Rebin a matrix</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">

<P><font size="+2" color="green">Rebin a matrix</font></P>
<P>
<TABLE border="1" cols="2" frame="box" rules="all" width="572">
<TR>
<TD width="15%" valign="top"><B>Syntax</B>:</TD>
<TD width="85%" valign="top"><CODE>
REBIN m mout nr nc</CODE>
</TD></TR>
</TABLE></P>
<P>
 Suppose that matrix <CODE>m</CODE> has <i>N</i> rows and <i>M</i> columns, then:</p>
<p>
 <center><img src="rebin6.png"></center></p>
<p>
 that is, the matrix <CODE>m</CODE> will have <i>N</i><code>/nr</CODE> rows and
 <i>M</i><code>/nc</CODE> columns.</p>
<p>
 <center><img src="rebin7.png"></center></p>
<p>
 If &nbsp;<img src="rebin8.png">&nbsp; is not equal to <i>N</i>, then the last row of
 <CODE>mout</CODE> will be incomplete.  If &nbsp;<img src="rebin9.png">&nbsp; is not equal to
 <i>M</i>, then the last column of <CODE>mout</CODE> will be incomplete.</p>
<p>
 <font size="+1" color="green">Example</font></p>
<p>
 Suppose that <code>M</code> is a matrix with <code>8</code> rows and <code>6</code> columns.</p>
<p>
 <img src="rebin10.png"></p>
<p>
 <table>
 <tr>
 <td bgcolor="#FFCCCC"><i>command</i></td><td bgcolor="#FFCCCC"><i>result</i></td>
 </tr><tr>
 <td valign="middle"><CODE><font color="blue">REBIN M MOUT 2 3</font></CODE></td>
 <td bgcolor=#FFFFCC><table><tr>
  <td><CODE>MOUT[1,1] = M[1,1]+M[2,1]+M[1,2]+M[2,2]+M[1,3]+M[2,3]</CODE></td></tr><tr>
  <td><CODE>MOUT[1,2] = M[1,4]+M[2,4]+M[1,5]+M[2,5]+M[1,6]+M[2,6]</CODE></td></tr><tr>
  <td><CODE>MOUT[2,1] = M[3,1]+M[4,1]+M[3,2]+M[4,2]+M[3,3]+M[4,3]</CODE></td></tr><tr>
  <td><CODE>MOUT[2,2] = M[3,4]+M[4,4]+M[3,5]+M[4,5]+M[3,6]+M[4,6]</CODE></td></tr><tr>
  <td><CODE>...</CODE></td></tr><tr>
  </table></td>
 </tr></table></P>
<p>
 <img src="rebin11.png"></p>
<P>
 <a href="vector.htm"><img src="../shadow_left.gif">&nbsp;
 <font size="+1" color="olive">REBIN a vector</font></a>
</P>
</body>
</html>