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 Power Operator

Overview

In this tutorial, we will learn about Octave Power Operator
with Examples.

Octave Power Operator

We have two operators in Octave to compute the power.

x ^ y
x ** y

The result of the computation depends on the values of the operands x and y.

If both x and y are scalars then

x ^ y returns the result x raised to the power of y.

If x is scalar and y is a square matrix the result would be eigenvalue expansion.

Examples

^ Operator

Let’s look at a simple example.

>> x = 2;
>> y = 3;
>> result = x ^ y;
>> result

result = 8

The result is 2*2*2 = 8

Octave Power Operator

** Operator

We can also use the ** operator.

>> x = 4;
>> y = 4;
>> result = x ** y;
>> result

result =  256

GNU Octave Power Operator Dobule Star

Element wise Power

To compute element-wise matrix power calculation, we can use the following operator.

x.^y

>> x = 2 ;
>> y = [2, 3; 3 , 5];
>> result = x.^ y

result =

                4            8
                8           32

 

—

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

‹ Octave Arithmetic Operators› Octave Addition Operator

Recent Posts

  • MS Access Data Types
  • 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

Go to mobile version