Mercurial > hg > octave-lyh
comparison scripts/general/accumarray.m @ 8507:cadc73247d65
style fixes
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 13 Jan 2009 14:08:36 -0500 |
parents | b93ac0586e4b |
children | 89b95972e178 |
comparison
equal
deleted
inserted
replaced
8506:bc982528de11 | 8507:cadc73247d65 |
---|---|
58 if (nargin < 2 || nargin > 6) | 58 if (nargin < 2 || nargin > 6) |
59 print_usage (); | 59 print_usage (); |
60 endif | 60 endif |
61 | 61 |
62 if (iscell (subs)) | 62 if (iscell (subs)) |
63 subs = cell2mat (cellfun (@(x) x(:), subs, 'UniformOutput', false)); | 63 subs = cell2mat (cellfun (@(x) x(:), subs, "UniformOutput", false)); |
64 endif | 64 endif |
65 ndims = size (subs, 2); | 65 ndims = size (subs, 2); |
66 | 66 |
67 if (nargin < 3 || isempty (sz)) | 67 if (nargin < 3 || isempty (sz)) |
68 sz = max (subs); | 68 sz = max (subs); |
105 if (isspar && fillval == 0) | 105 if (isspar && fillval == 0) |
106 A = sparse (idx{1}, idx{2}, x, sz(1), sz(2)); | 106 A = sparse (idx{1}, idx{2}, x, sz(1), sz(2)); |
107 else | 107 else |
108 if (iscell (x)) | 108 if (iscell (x)) |
109 ## Why did matlab choose to reverse the order of the elements | 109 ## Why did matlab choose to reverse the order of the elements |
110 x = cellfun (@(x) flipud (x(:)), x, 'UniformOutput', false); | 110 x = cellfun (@(x) flipud (x(:)), x, "UniformOutput", false); |
111 A = cell (sz); | 111 A = cell (sz); |
112 elseif (fillval == 0) | 112 elseif (fillval == 0) |
113 A = zeros (sz, class (x)); | 113 A = zeros (sz, class (x)); |
114 else | 114 else |
115 A = fillval .* ones (sz); | 115 A = fillval .* ones (sz); |