Last change
on this file since 177 was
37,
checked in by (none), 15 years ago
|
Added original make3d
|
-
Property svn:executable set to
*
|
File size:
646 bytes
|
Line | |
---|
1 | % vgg_vec De-/vectorization of a matrix.
|
---|
2 | %
|
---|
3 | % For a matrix X, vgg_vec(X) = X(:).
|
---|
4 | % For a N^2-vector x, vgg_vec(x) = reshape(x,N,N).
|
---|
5 | %
|
---|
6 | % Classical matrix re-arrangement operator, see book Magnus-Neudecker.
|
---|
7 | % Trivial function, included mainly for consistency with notation in literature.
|
---|
8 | %
|
---|
9 | % Useful for rearranging matrix equations. Matrix from the middle of a product can be put to the right as
|
---|
10 | %
|
---|
11 | % vgg_vec(A*B*C) = kron(C',A)*vgg_vec(B)
|
---|
12 | %
|
---|
13 | % See also vgg_vec_swap, vgg_commut_matrix, vgg_duplic_matrix.
|
---|
14 |
|
---|
15 | function v = vgg_vec(A)
|
---|
16 |
|
---|
17 | if any(size(A)==1)
|
---|
18 | v = reshape(A,[1 1]*sqrt(prod(size(A))));
|
---|
19 | else
|
---|
20 | v = A(:);
|
---|
21 | end
|
---|
22 |
|
---|
23 | return |
---|
Note: See
TracBrowser
for help on using the repository browser.