Octave commands

From Notes_Wiki

Home > Octave > Octave commands

print To export already generated plot to some file in known image format we can use print() function. For example to save plot in png image file with name plot1.png one can use command 'print -dpng plot1.png' after generating plot. The file 'plot1.png' will get created in current working folder of octave. We can optionally also give full path of directory where we want to export image. Use 'help plot' to see what other image formats are supported while exporting graphs.
ls Lists files in current directory.
pwd Prints current working directory
cd can be used to change current working directory
help To see help on some function / command.
lookfor To search for given term in help pages and list help topics which contain that term. (Kind of like 'apropos' and 'whatis')
diary Like script command stores both input and output of terminal, the diary command can be used to store input/ouput of octave session.
clear Clear command can be used to clear already defined variables / functions from octave symbol table. If we call clear without any argument then all variables defined so far will get cleared. We can specify optional pattern in shell pattern format to clear only specific variables. Use `help clear' to see more advanced usage options of this command.
who Prints list of currently used variable names. We can use keyword `global' to see list of variables in global scope and not local scope. We can also optionally specify pattern in shell pattern style to match against variables names to be listed. This command also supports taking pattern in regular expression format and taking variable names from file. Use `help who' for more details on this command.
whos Provides detailed information on all declared variables. It also supports options and patterns same as who command. The output of whos command can be modified using function `whos_line_format'
type Find type of string supplied as argument. If argument is name of function defined in file then entire code in that file is displayed on screen. If argument is variable value of variable is also displayed on screen. For built-in function output that the argument is built-in function is displayed.
which This is similar to type command but this only works for functions and nothing is displayed for variables. Also it just prints path of file if function is defined in the file, it wont display entire contents of file like `type command does.


Home > Octave > Octave commands