12.07.2015 Views

GNU Octave - Local Sector 7 web page

GNU Octave - Local Sector 7 web page

GNU Octave - Local Sector 7 web page

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 9: Variables 59exist (name, type)Built-in FunctionReturn 1 if the name exists as a variable, 2 if the name (after appending ‘.m’) isa function file in <strong>Octave</strong>’s LOADPATH, 3 if the name is a ‘.oct’ file in <strong>Octave</strong>’sLOADPATH, 5 if the name is a built-in function, 7 if the name is a directory, 101 ifthe name is a built-in variable, 102 if the name is a built-in constant, or 103 if thename is a function not associated with a file (entered on the command line).Otherwise, return 0.This function also returns 2 if a regular file called name exists in <strong>Octave</strong>’s LOADPATH.If you want information about other types of files, you should use some combinationof the functions file_in_path and stat instead.If the optional argument type is supplied, check only for symbols of the specified type.Valid types are‘"var"’Check only for variables.‘"builtin"’Check only for built-in functions.‘"file"’‘"dir"’Check only for files.Check only for directories.document (symbol, text)Set the documentation string for symbol to text.Built-in Functiontype options name . . .Display the definition of each name that refers to a function.CommandNormally also displays if each name is user-defined or builtin; the -q option suppressesthis behaviour.Currently, <strong>Octave</strong> can only display functions that can be compiled cleanly, because ituses its internal representation of the function to recreate the program text.Comments are not displayed because <strong>Octave</strong>’s parser currently discards them as itconverts the text of a function file to its internal representation. This problem maybe fixed in a future release.which name . . .CommandDisplay the type of each name. If name is defined from a function file, the full nameof the file is also displayed.9.4 Summary of Built-in VariablesHere is a summary of all of <strong>Octave</strong>’s built-in variables along with cross references toadditional information and their default values. In the following table octave-home standsfor the root directory where all of <strong>Octave</strong> is installed (the default is ‘/usr/local’, versionstands for the <strong>Octave</strong> version number (for example, 2.1.x) and arch stands for the type ofsystem for which <strong>Octave</strong> was compiled (for example, i586-pc-linux-gnu).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!