Mercurial > hg > smallbox
annotate Problems/private/collincomb.m @ 10:207a6ae9a76f version1.0
(none)
author | idamnjanovic |
---|---|
date | Mon, 22 Mar 2010 15:06:25 +0000 |
parents | |
children |
rev | line source |
---|---|
idamnjanovic@10 | 1 %COLLINCOMB Linear combination of matrix columns. |
idamnjanovic@10 | 2 % Y = COLLINCOMB(A,COLS,X) computes a linear combination of the columns of |
idamnjanovic@10 | 3 % the matrix A. The column indices are specified in the vector COLS, and |
idamnjanovic@10 | 4 % the correspoinding coefficients are specified in the vector X. The |
idamnjanovic@10 | 5 % vectors COLS and X must be of the same length. |
idamnjanovic@10 | 6 % |
idamnjanovic@10 | 7 % The call Y = COLLINCOMB(A,COLS,X) is essentially equivalent to |
idamnjanovic@10 | 8 % |
idamnjanovic@10 | 9 % Y = A(:,COLS)*X . |
idamnjanovic@10 | 10 % |
idamnjanovic@10 | 11 % However, it is implemented much more efficiently. |
idamnjanovic@10 | 12 % |
idamnjanovic@10 | 13 % Y = COLLINCOMB(A,ROWS,COLS,X) only works on the rows of A specified |
idamnjanovic@10 | 14 % in ROWS, returning a vector of length equal to ROWS. This call is |
idamnjanovic@10 | 15 % essentially equivalent to the command |
idamnjanovic@10 | 16 % |
idamnjanovic@10 | 17 % Y = A(ROWS,COLS)*X . |
idamnjanovic@10 | 18 % |
idamnjanovic@10 | 19 % See also ROWLINCOMB. |
idamnjanovic@10 | 20 |
idamnjanovic@10 | 21 |
idamnjanovic@10 | 22 % Ron Rubinstein |
idamnjanovic@10 | 23 % Computer Science Department |
idamnjanovic@10 | 24 % Technion, Haifa 32000 Israel |
idamnjanovic@10 | 25 % ronrubin@cs |
idamnjanovic@10 | 26 % |
idamnjanovic@10 | 27 % April 2009 |