Repository URL to install this package:
|
Version:
4.4.5.dfsg-3ubuntu2 ▾
|
<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>
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
<CODE>UNFOLD(FOLD(X,N))</code> is equal to <code>X</CODE></p>
<p>
If <CODE>M</CODE> is a matrix with <CODE>R</CODE> rows, then
<CODE>FOLD(UNFOLD(M),R)</code> is equal to <code>M</CODE></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>
</BODY>
</HTML>