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 Arithmetic Operators

Overview

In this tutorial, we will learn about Octave Arithmetic Operators. Arithmetic operators can be used for performing various mathematical operations on the variables. We can use these operators on both scalars and on vectors.

Octave Arithmetic Operators

An arithmetic operator is a symbol that Octave uses for arithmetic operations like addition, subtraction, multiplication, division, and exponentiation.

The arithmetic operators symbols are as follows:

Arithmetic Operation
Operator Symbol  Example
Addition

 

+ a + b
Subtraction – a – b
Multiplication * a * b
Left Division

Right Division

\

/  

a / b
Power/Exponentiation **  or ^ a ** b or a ^b

Example

Let’s compute the sum of 10 and 25.

In this example, we will declare two scalar variables. Add the variables with the addition operator and print the result.

a = 10;

b = 25;

result = a + b ;

Screenshot

Octave Arithmetic Operator

 

Element wise operations on Vectors

Arithmetic Operation
Operator Symbol  Example
Addition

 

.+ a .+ b
Subtraction .- a .- b
Multiplication .* a .* b
Division ./ a ./ b
Power .**  or .^ a .** b

—

Octave Tutorials

GNU Octave Tutorials on this website can be found at:

https://www.testingdocs.com/octave-tutorial/

For more information on Octave, visit 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

‹ Comments in Octave Scripts› Octave Power Operator

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