annotate scripts/linear-algebra/vec.m @ 2990:35bd1b05cfbe

[project @ 1997-05-16 09:19:11 by jwe]
author jwe
date Fri, 16 May 1997 09:19:12 +0000
parents c3d634d49ce4
children f37ca3017116
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2540
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
1 ## Copyright (C) 1995, 1996 Kurt Hornik
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
2 ##
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
3 ## This program is free software; you can redistribute it and/or modify
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
4 ## it under the terms of the GNU General Public License as published by
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
5 ## the Free Software Foundation; either version 2, or (at your option)
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
6 ## any later version.
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
7 ##
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
8 ## This program is distributed in the hope that it will be useful, but
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
9 ## WITHOUT ANY WARRANTY; without even the implied warranty of
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
11 ## General Public License for more details.
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
12 ##
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
13 ## You should have received a copy of the GNU General Public License
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
14 ## along with this file. If not, write to the Free Software Foundation,
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
15 ## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
16
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
17 ## usage: vec (x)
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
18 ##
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
19 ## Returns vec (x), the vector obtained by stacking the columns of x
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
20 ## one above the other.
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
21 ##
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
22 ## See Magnus and Neudecker (1988), Matrix differential calculus with
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
23 ## applications in statistics and econometrics.
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
24
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
25 ## Author: KH <Kurt.Hornik@ci.tuwien.ac.at>
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
26 ## Created: 8 May 1995
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
27 ## Adapted-By: jwe
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
28
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
29 function v = vec (x)
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
30
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
31 if (nargin != 1)
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
32 usage ("vec (x)");
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
33 endif
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
34
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
35 v = reshape (x, prod (size (x)), 1);
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
36
c3d634d49ce4 [project @ 1996-11-20 00:20:12 by jwe]
jwe
parents:
diff changeset
37 endfunction