Mercurial > hg > octave-nkf
diff scripts/general/trapz.m @ 10549:95c3e38098bf
Untabify .m scripts
author | Rik <code@nomad.inbox5.com> |
---|---|
date | Fri, 23 Apr 2010 11:28:50 -0700 |
parents | 1bf0ce0930be |
children | 35adf2a71f3f |
line wrap: on
line diff
--- a/scripts/general/trapz.m +++ b/scripts/general/trapz.m @@ -30,13 +30,13 @@ ## @seealso{cumtrapz} ## @end deftypefn -## Author: Kai Habel <kai.habel@gmx.de> +## Author: Kai Habel <kai.habel@gmx.de> ## ## also: June 2000 - Paul Kienzle (fixes,suggestions) ## 2006-05-12 David Bateman - Modified for NDArrays function z = trapz (x, y, dim) - + if (nargin < 1) || (nargin > 3) print_usage (); @@ -83,7 +83,7 @@ idx1{i} = 1:sz(i); endfor idx2 = idx1; - idx1{dim} = 2 : n; + idx1{dim} = 2 : n; idx2{dim} = 1 : (n - 1); if (! have_x) @@ -93,7 +93,7 @@ error ("trapz: x and y must have same shape"); endif z = 0.5 * sum ((x(idx1{:}) - x(idx2{:})) .* - (y(idx1{:}) + y(idx2{:})), dim); + (y(idx1{:}) + y(idx2{:})), dim); endif endfunction