Mercurial > hg > octave-nkf
diff scripts/plot/__fltk_ginput__.m @ 11194:b8585f8e11d5
__fltk_ginput__.m: Use semicolons to prevent internal function evaluations being output to screen.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Thu, 04 Nov 2010 13:34:58 -0700 |
parents | 8b9aeb20c03c |
children | fd0a3ac60b0e |
line wrap: on
line diff
--- a/scripts/plot/__fltk_ginput__.m +++ b/scripts/plot/__fltk_ginput__.m @@ -29,9 +29,7 @@ error ("ginput: must have at least one axes"); endif - x = []; - y = []; - button = []; + x = y = button = []; ginput_aggregator (0, 0, 0); unwind_protect @@ -64,18 +62,18 @@ endfunction function [x, y, n] = ginput_aggregator (mode , xn, yn) - persistent x y n + persistent x y n; - if (mode == 0), + if (mode == 0) x = []; y = []; n = 0; elseif (mode == 1) - x = [x, xn]; - y = [y, yn]; + x = [x; xn]; + y = [y; yn]; n += 1; elseif (mode == 2) - n = -1 + n = -1; endif endfunction @@ -85,8 +83,8 @@ endfunction function ginput_keypressfcn (src, evt) - if (evt.Key == 10) - ginput_aggregator (2, 0, 0) + if (evt.Key == 10) # linefeed character + ginput_aggregator (2, 0, 0); endif endfunction