Mercurial > octave-nkf
comparison scripts/deprecated/dmult.m @ 12728:a17269b1148f stable
maint: undo unintended change removing deprecated functions
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 09 Jun 2011 13:35:10 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
12727:40b16bb69fec | 12728:a17269b1148f |
---|---|
1 ## Copyright (C) 1995-2011 Kurt Hornik | |
2 ## | |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7 ## the Free Software Foundation; either version 3 of the License, or (at | |
8 ## your option) any later version. | |
9 ## | |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
16 ## along with Octave; see the file COPYING. If not, see | |
17 ## <http://www.gnu.org/licenses/>. | |
18 | |
19 ## -*- texinfo -*- | |
20 ## @deftypefn {Function File} {} dmult (@var{a}, @var{b}) | |
21 ## This function has been deprecated. Use the direct syntax @code{diag(A)*B} | |
22 ## which is more readable and now also more efficient. | |
23 ## @end deftypefn | |
24 | |
25 ## Author: KH <Kurt.Hornik@wu-wien.ac.at> | |
26 ## Description: Rescale the rows of a matrix | |
27 | |
28 ## Deprecated in version 3.2 | |
29 | |
30 function M = dmult (a, B) | |
31 | |
32 persistent warned = false; | |
33 if (! warned) | |
34 warned = true; | |
35 warning ("Octave:deprecated-function", | |
36 "dmult is obsolete and will be removed from a future version of Octave; please use the straightforward (and now efficient) syntax \"diag(A)*B\""); | |
37 endif | |
38 | |
39 if (nargin != 2) | |
40 print_usage (); | |
41 endif | |
42 if (! isvector (a)) | |
43 error ("dmult: a must be a vector of length rows (B)"); | |
44 endif | |
45 a = a(:); | |
46 sb = size (B); | |
47 sb(1) = 1; | |
48 M = repmat (a(:), sb) .* B; | |
49 endfunction |