Mercurial > octave-nkf
annotate scripts/deprecated/dmult.m @ 11523:fd0a3ac60b0e
update copyright notices
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 14 Jan 2011 05:47:45 -0500 |
parents | 8207b833557f |
children | d5bd2766c640 |
rev | line source |
---|---|
11523 | 1 ## Copyright (C) 1995-2011 Kurt Hornik |
8826 | 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}) | |
9065
8207b833557f
Cleanup documentation for arith.texi, linalg.texi, nonlin.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
21 ## This function has been deprecated. Use the direct syntax @code{diag(A)*B} |
8826 | 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 | |
8827
55d999c23728
omission from last patch
Jaroslav Hajek <highegg@gmail.com>
parents:
8826
diff
changeset
|
28 ## Deprecated in version 3.2 |
55d999c23728
omission from last patch
Jaroslav Hajek <highegg@gmail.com>
parents:
8826
diff
changeset
|
29 |
8826 | 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 |