# HG changeset patch # User Rik # Date 1326950234 28800 # Node ID 190952239c2cf7e062a1b9ef68914f57aa09590d # Parent b03b15d507d4f0c0842e01b85c01791b7df7a847 Use '!' for not operation in preference to '~'. * profexplore.m, inpolygon.m, __gnuplot_drawnow__.m, spline.m: Use '!' for not operation in preference to '~'. diff --git a/scripts/general/profexplore.m b/scripts/general/profexplore.m --- a/scripts/general/profexplore.m +++ b/scripts/general/profexplore.m @@ -32,7 +32,7 @@ function profexplore (data) - if (nargin ~= 1) + if (nargin != 1) print_usage (); endif @@ -87,7 +87,7 @@ printf ("help Display this help message.\n"); printf ("up [N] Go up N levels, where N is an integer. Default is 1.\n"); printf ("N Go down a level into option N.\n"); - elseif (~isnan (option)) + elseif (! isnan (option)) if (option < 1 || option > length (tree)) printf ("The chosen option is out of range!\n"); else @@ -115,7 +115,7 @@ if (length (cmd) > 3 && cmd(3) == ' ') opt = fix (str2double (substr (cmd, 3))); - if (~isnan (opt) && opt > 0) + if (! isnan (opt) && opt > 0) rv = opt; return; endif diff --git a/scripts/geometry/inpolygon.m b/scripts/geometry/inpolygon.m --- a/scripts/geometry/inpolygon.m +++ b/scripts/geometry/inpolygon.m @@ -100,7 +100,7 @@ %! plot(xv,yv) %! hold on %! plot(x(inside),y(inside),"@g") -%! plot(x(~in),y(~in),"@m") +%! plot(x(!in),y(!in),"@m") %! plot(x(on),y(on),"@b") %! hold off %! disp("Green points are inside polygon, magenta are outside,"); @@ -120,11 +120,11 @@ %! [x,y]=meshgrid(xa,ya); %! [in,on]=inpolygon(x,y,xv,yv); %! -%! inside=in & ~ on; +%! inside=in & !on; %! plot(xv,yv) %! hold on %! plot(x(inside),y(inside),"@g") -%! plot(x(~in),y(~in),"@m") +%! plot(x(!in),y(!in),"@m") %! plot(x(on),y(on),"@b") %! hold off %! disp("Green points are inside polygon, magenta are outside,"); diff --git a/scripts/plot/__gnuplot_drawnow__.m b/scripts/plot/__gnuplot_drawnow__.m --- a/scripts/plot/__gnuplot_drawnow__.m +++ b/scripts/plot/__gnuplot_drawnow__.m @@ -147,7 +147,7 @@ if (! isempty (h) && isfigure (h)) ## Generate gnuplot title string for plot windows. - if (output_to_screen (term) && ~strcmp (term, "dumb")) + if (output_to_screen (term) && ! strcmp (term, "dumb")) fig.numbertitle = get (h, "numbertitle"); fig.name = strrep (get (h, "name"), "\"", "\\\""); if (strcmpi (get (h, "numbertitle"), "on")) @@ -210,7 +210,7 @@ size_str = sprintf ("size %gin,%gin", gnuplot_size); case "dumb" new_stream = 1; - if (~isempty (getenv ("COLUMNS")) && ~isempty (getenv ("LINES"))) + if (! isempty (getenv ("COLUMNS")) && ! isempty (getenv ("LINES"))) ## Let dumb use full text screen size (minus prompt lines). n = sprintf ("%i", -2 - length (find (sprintf ("%s", PS1) == "\n"))); ## n = the number of times \n appears in PS1 diff --git a/scripts/polynomial/spline.m b/scripts/polynomial/spline.m --- a/scripts/polynomial/spline.m +++ b/scripts/polynomial/spline.m @@ -107,7 +107,7 @@ a = a(2:end-1,:); endif - if (~issorted (x)) + if (! issorted (x)) [x, idx] = sort(x); a = a(idx,:); endif