diff examples/code/@polynomial/display.m @ 21059:73ab962bc52d

doc: Use newer coding conventions in examples/code directory. * FIRfilter.m, FIRfilter_aggregation.m, display.m, subsasgn.m, subsref.m, display.m, end.m, get.m, numel.m, plot.m, polynomial.m, polynomial_superiorto.m, polyval.m, roots.m, set.m, subsasgn.m, subsref.m, celldemo.cc, fortrandemo.cc, funcdemo.cc, globaldemo.cc, oct_demo.cc, paramdemo.cc, stringdemo.cc: Use newer coding conventions in examples/code directory.
author Rik <rik@octave.org>
date Wed, 13 Jan 2016 16:21:24 -0800
parents c8240a60dd01
children fd97ed44f2da
line wrap: on
line diff
--- a/examples/code/@polynomial/display.m	Wed Jan 13 17:28:42 2016 +1100
+++ b/examples/code/@polynomial/display.m	Wed Jan 13 16:21:24 2016 -0800
@@ -1,32 +1,35 @@
 function display (p)
+
   a = p.poly;
   first = true;
-  fprintf ("%s =", inputname (1));
+  printf ("%s =", inputname (1));
   for i = 1 : length (a);
     if (a(i) != 0)
       if (first)
         first = false;
       elseif (a(i) > 0)
-        fprintf (" +");
+        printf (" +");
       endif
       if (a(i) < 0)
-        fprintf (" -");
+        printf (" -");
       endif
       if (i == 1)
-        fprintf (" %g", abs (a(i)));
+        printf (" %g", abs (a(i)));
       elseif (abs(a(i)) != 1)
-        fprintf (" %g *", abs (a(i)));
+        printf (" %g *", abs (a(i)));
       endif
       if (i > 1)
-        fprintf (" X");
+        printf (" X");
       endif
       if (i > 2)
-        fprintf (" ^ %d", i - 1);
+        printf (" ^ %d", i - 1);
       endif
     endif
   endfor
+
   if (first)
-    fprintf (" 0");
+    printf (" 0");
   endif
-  fprintf ("\n");
+  printf ("\n");
+
 endfunction