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
|
<HTML>
<HEAD>
<TITLE>UNFOLD</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF" fgcolor="#000000">
<P><A NAME="unfold"></A>
<font size="+3" color="green"><B>UNFOLD</B></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%"><CODE>
vector = UNFOLD( matrix )</CODE>
</TD></TR>
</table></p>
<p>
The <CODE>UNFOLD</CODE> function has one argument, which must be a
matrix. The result is a vector formed by unfolding the rows of the matrix.</P>
<P>
Suppose that matrix <CODE>m</CODE> has <CODE>r</CODE> rows and <CODE>c</CODE> columns.
Then</p>
<p>
<CODE>UNFOLD(m)[i+(j-1)*r] = m[i,j]</CODE> for <CODE>i = 1,2,...,r</CODE> and
<CODE>j = 1,2,...,c</CODE>.</P>
<P>
<font size="+1" color="green">Examples</font></P>
<P>
Suppose that
<pre>
| 1 4 7 10 |
M = | 2 5 8 11 |
| 3 6 9 12 |
</pre>
<table>
<tr>
<td bgcolor="#FFCCCC"><i>function</i></td><td bgcolor="#FFCCCC"><i>result</i></td>
</tr><tr>
<td><CODE><font color="blue">UNFOLD(M)</font></CODE></td>
<td bgcolor="#FFFFCC"><CODE>[1;2;3;4;5;6;7;8;9;10;11;12]</CODE></td>
</tr></table></P>
<P>
<table><tr>
<td valign=top>Note:</td>
<td>if <CODE>X</CODE> is a vector and <CODE>N</CODE> is a scalar such than
<CODE>LEN(X)</CODE> is divisible by <CODE>N</CODE>, then<br />
<CODE>UNFOLD(FOLD(X,N))</code> is equal to <code>X</CODE></td>
</tr><tr>
<td></td>
<td>if <CODE>M</CODE> is a matrix with <CODE>R</CODE> rows, then<br />
<CODE>FOLD(UNFOLD(M),R)</code> is equal to <code>M</CODE></td>
</tr></table></P>
<p>
<a href="fold.htm"><img align=middle border="0" src="../../shadow_left.gif">
<font size="+1" color="olive">FOLD</font></a>
</P>
</BODY>
</HTML>
|