Mercurial > hg > octave-nkf
diff scripts/sparse/spones.m @ 11469:c776f063fefe
Overhaul m-script files to use common variable name between code and documentation.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 09 Jan 2011 12:41:21 -0800 |
parents | 16f53d29049f |
children | fd0a3ac60b0e |
line wrap: on
line diff
--- a/scripts/sparse/spones.m +++ b/scripts/sparse/spones.m @@ -17,21 +17,21 @@ ## <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {@var{y} =} spones (@var{x}) -## Replace the non-zero entries of @var{x} with ones. This creates a -## sparse matrix with the same structure as @var{x}. +## @deftypefn {Function File} {@var{r} =} spones (@var{S}) +## Replace the non-zero entries of @var{S} with ones. This creates a +## sparse matrix with the same structure as @var{S}. ## @end deftypefn -function s = spones (s) +function r = spones (S) if (nargin != 1) print_usage (); endif - [i, j, v] = find (s); - [m, n] = size (s); + [i, j, v] = find (S); + [m, n] = size (S); - s = sparse (i, j, 1, m, n); + r = sparse (i, j, 1, m, n); endfunction