"Octave" (External Evaluation System)
Details
- GNU Octave is a scientific programming language with powerful mathematics-oriented syntax.
- Octave Version 4.2.2 and higher is supported.
- To configure Octave for use in the Wolfram Language, follow the instructions from the Configure Octave for ExternalEvaluate workflow.
ExternalEvaluate Usage
- ExternalEvaluate["Octave",code] executes the code string in Octave and returns the results as a Wolfram Language expression.
Data Types
- The following Octave built-in types are supported:
-
logical True False Boolean True/False values int8, int16, int32, etc. Integer integer float Real real number complex Complex complex number (returning from Octave only) char String string of characters matrix List list of objects struct Association associative array cell List variable container of different size and type Inf ComplexInfinity quantity with infinite magnitude NaN Indeterminate not well defined numerical result
Examples
open allclose allBasic Examples (1)
Evaluate 2+2 in Octave and return the result:
Type > and select Octave from the drop-down menu to get a code cell that uses ExternalEvaluate to evaluate:
Scope (11)
Evaluate a Boolean statement in Octave and return the result:
Compute the magnitude of a complex number in Octave and return the result:
Dictionaries in Octave are returned as associations:
Create a Complex number in Octave and return the result:
Session Options (4)
"ReturnType" (2)
For the Octave evaluation system, the default return type is "Expression":
Numbers, strings, lists and associations are automatically imported for the "Expression" return type:
"Version" (1)
Command Options (4)
"Command" (2)
When only a string of Octave code is provided, the command is directly executed:
The above is equivalent to writing the command using this form:
Put code in a CloudObject:
Evaluate directly from the cloud:
The above is equivalent to writing the command using this form:
"Arguments" (2)
Use "Arguments" to call the result of the evaluation with arguments:
When a non-list argument is provided, a single argument is passed to the function:
You can define a function inside "Command" and directly call it with "Arguments":
The same result can be achieved by using a Rule:
You can also pass arguments by creating an ExternalFunction: