# HG changeset patch # User John W. Eaton # Date 1411323664 14400 # Node ID 4990d5988cf5d4e72dc8de035d8319a4e64aa433 # Parent df5e4024ec18817a36d735ae0752271c3d8fbfa7 new function, isstudent (bug #43155) * utils.cc (Fisstudent): New function. * system.txi: Include docstring for isstudent. diff -r df5e4024ec18 -r 4990d5988cf5 doc/interpreter/system.txi --- a/doc/interpreter/system.txi Sun Sep 21 11:05:10 2014 -0700 +++ b/doc/interpreter/system.txi Sun Sep 21 14:21:04 2014 -0400 @@ -515,6 +515,8 @@ @DOCSTRING(isdeployed) +@DOCSTRING(isstudent) + @DOCSTRING(OCTAVE_HOME) @DOCSTRING(matlabroot) diff -r df5e4024ec18 -r 4990d5988cf5 libinterp/corefcn/utils.cc --- a/libinterp/corefcn/utils.cc Sun Sep 21 11:05:10 2014 -0700 +++ b/libinterp/corefcn/utils.cc Sun Sep 21 14:21:04 2014 -0400 @@ -1479,3 +1479,23 @@ stream.width (owidth); stream.fill (ofill); } + +DEFUN (isstudent, args, , + "-*- texinfo -*-\n\ +@deftypefn {Built-in Function} {} isstudent ()\n\ +Return true if running in the student edition of Matlab.\n\ +Always return false in Octave.\n\ +\n\ +@seealso{false}\n\ +@end deftypefn") +{ + if (args.length () != 0) + print_usage (); + + return octave_value (false); +} + +/* +%!assert (isstudent (), false); +%!error isstudent (1); +*/