Mercurial > hg > octave-lyh
annotate scripts/deprecated/dmult.m @ 8874:bd1b1fe9c6e9 ss-3-1-53
bump version info for snapshot
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 25 Feb 2009 18:35:47 -0500 |
parents | 55d999c23728 |
children | eb63fbe60fab |
rev | line source |
---|---|
8826 | 1 ## Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2004, 2005, 2006, |
2 ## 2007 Kurt Hornik | |
3 ## | |
4 ## This file is part of Octave. | |
5 ## | |
6 ## Octave is free software; you can redistribute it and/or modify it | |
7 ## under the terms of the GNU General Public License as published by | |
8 ## the Free Software Foundation; either version 3 of the License, or (at | |
9 ## your option) any later version. | |
10 ## | |
11 ## Octave is distributed in the hope that it will be useful, but | |
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 ## General Public License for more details. | |
15 ## | |
16 ## You should have received a copy of the GNU General Public License | |
17 ## along with Octave; see the file COPYING. If not, see | |
18 ## <http://www.gnu.org/licenses/>. | |
19 | |
20 ## -*- texinfo -*- | |
21 ## @deftypefn {Function File} {} dmult (@var{a}, @var{b}) | |
22 ## This function has been deprecated. Use the direct syntax @code{diag(A)*B} | |
23 ## which is more readable and now also more efficient. | |
24 ## @end deftypefn | |
25 | |
26 ## Author: KH <Kurt.Hornik@wu-wien.ac.at> | |
27 ## Description: Rescale the rows of a matrix | |
28 | |
8827
55d999c23728
omission from last patch
Jaroslav Hajek <highegg@gmail.com>
parents:
8826
diff
changeset
|
29 ## Deprecated in version 3.2 |
55d999c23728
omission from last patch
Jaroslav Hajek <highegg@gmail.com>
parents:
8826
diff
changeset
|
30 |
8826 | 31 function M = dmult (a, B) |
32 | |
33 persistent warned = false; | |
34 if (! warned) | |
35 warned = true; | |
36 warning ("Octave:deprecated-function", | |
37 "dmult is obsolete and will be removed from a future version of Octave; please use the straightforward (and now efficient) syntax ""diag(A)*B""."); | |
38 endif | |
39 | |
40 if (nargin != 2) | |
41 print_usage (); | |
42 endif | |
43 if (! isvector (a)) | |
44 error ("dmult: a must be a vector of length rows (B)"); | |
45 endif | |
46 a = a(:); | |
47 sb = size (B); | |
48 sb(1) = 1; | |
49 M = repmat (a(:), sb) .* B; | |
50 endfunction |