Mercurial > octave
diff scripts/signal/movfun.m @ 30379:363fb10055df stable
maint: Style check m-files ahead of 7.1 release.
* Map.m, integral3.m, logspace.m, quad2d.m, quadgk.m, quadl.m, tsearchn.m,
get_first_help_sentence.m, print_usage.m, getframe.m, imformats.m,
javaclasspath.m, condest.m, null.m, ordeig.m, inputParser.m, license.m,
memory.m, methods.m, __publish_html_output__.m, __publish_latex_output__.m,
publish.m, ode15s.m, fminbnd.m, fzero.m, configure_make.m, get_description.m,
get_forge_pkg.m, annotation.m, camlookat.m, legend.m, __gnuplot_legend__.m,
bar.m, colorbar.m, fill3.m, isosurface.m, plotyy.m, polar.m, __bar__.m,
__ezplot__.m, __patch__.m, __pie__.m, __plt__.m, __scatter__.m, smooth3.m,
stemleaf.m, __gnuplot_drawnow__.m, print.m, printd.m, __add_default_menu__.m,
__gnuplot_draw_axes__.m, __gnuplot_print__.m, __print_parse_opts__.m,
struct2hdl.m, profexport.m, profile.m, movfun.m, sprandsym.m, betaincinv.m,
factor.m, nchoosek.m, gallery.m, hadamard.m, iqr.m, ranks.m,
__run_test_suite__.m, test.m, datevec.m, weboptions.m:
Style check m-files ahead of 7.1 release.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 26 Nov 2021 20:53:22 -0800 |
parents | 628f26e122d9 |
children | 796f54d4ddbf |
line wrap: on
line diff
--- a/scripts/signal/movfun.m Fri Nov 26 18:13:08 2021 -0800 +++ b/scripts/signal/movfun.m Fri Nov 26 20:53:22 2021 -0800 @@ -362,17 +362,20 @@ ## 'y' values outside window are replaced by value of 'x' at the window ## boundary. function y = same_bc (fcn, x, idxp, win, ~, ~) + idx = idxp + win; idx(idx < 1) = 1; N = length (x); idx(idx > N) = N; y = fcn (x(idx)); + endfunction ## Apply "periodic" boundary conditions ## Window wraps around. Window values outside data array are replaced with ## data from the other end of the array. function y = periodic_bc (fcn, x, idxp, win, ~, ~) + N = length (x); idx = idxp + win; tf = idx < 1; @@ -380,6 +383,7 @@ tf = idx > N; idx(tf) = idx(tf) - N; y = fcn (x(idx)); + endfunction