Simulate > Console > Solvers > MATLAB
Simulate > Console > Solvers > Octave
The chosen Solver is set automatically to one of these:
- var matlab = new Solver("matlab");
- var octave = new Solver("octave");
If the background Octave or MATLAB is accessible, the Console will prompt with the starting detail and be ready to accept any input.
The executed command will be added to the main output panel, with any output from the command.
The Solvers can then be accessed using the Solver Class functions; for example:
- matlab.set('<variable_name>', <value>)
- matlab.exec(<function>, <parameters>)
- octave.set('<variable_name>', <value>)
- octave.exec(<function>, <parameters>)
For more details see the Octave Solver and the MATLAB Solver Help topics.
Previous commands that have been entered can be re-used by pressing thekey or Down Arrow key.
To output the value of a variable or a function you can use:
- ? <variable_name>
- ? <function>
This illustration shows some examples of using the Octave Solver's Set, Get and Exec, as well as the output using ?, in the Octave Console:
The Octave plot is the generated output of the two ocatave.exec() statements.
Console commands are preceded by the ! character and instruct the Console to perform an action. The Console commands include:
- !clear - clears the Console display
- !save - saves the Console display to a file
- !help - prints a list of commands
- !close - closes the Console
- !include <scriptname> - executes the named script item; scriptname is of the format GroupName.ScriptName (spaces are allowed in names)
- ? - lists commands (same as !help)
- ? <variable or function> - outputs the value