TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Octave

Octave Functions

Overview

In this tutorial, we will learn about Octave Functions.
We can define functions in separate external files or interactively in the command window. Octave functions can be:

  • Built-In Functions
  • User-defined Functions

Some Octave built-in functions are listed here:

https://www.testingdocs.com/octave-built-in-functions/

Define Function

The function syntax is shown below:

function return_value = name(arguments_list)
           function_body
endfunction

The function_body consists of Octave statements.

Create Function

To create a new function click the following menu option:

File >> New >> New Function…

 

Octave New Function

Enter the new function name. Octave would create the filename with the .m extension. For example, the function Foo would be created in Foo.m function file.

The file would open in the Editor pane. We can edit and the function body and save the file.

function retval = Foo (input1, input2)
       fprintf(‘Foo Function \n’);
endfunction

 

Octave Functions

Function Example

https://www.testingdocs.com/user-defined-function-in-octave/

—

Octave Tutorials

Octave Tutorial on this website can be found at:
https://www.testingdocs.com/octave-tutorial/

More information on Octave can be found on the official website:
https://www.gnu.org/software/octave/index

Related Posts

Octave Package List

Octave /

Install Octave Packages on Linux

Octave /

Octave User defined Function Example

octave command line linux

Octave /

Octave Command line on Ubuntu

Hello World in Octave

Octave /

Hello World in Octave

Octave /

Octave plot example of function y=x^2

‹ Octave Arithmetic Operator Precedence› Octave plot command

Recent Posts

  • Update draw.io on Windows
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com