Octave Support

It's possible to use Octave in Mumie. Octave is a free software for solving mathematical problems. It's similar to MATLAB, and compatible to MATLAB to a large extend. See http://en.wikipedia.org/wiki/GNU_Octave for more information.

Octave Input Field in Documents

An Author can add Octave Input field with a prefilled Octave code which the user can edit, and see the Octave response in an output field after hitting an execute button.
The Octave code is sent to the server, executed in an Octave process on the server, and the result is sent back to the client. Authors can add this functionality to their documents by the TeX commands \octaveinput, \octavebutton, \octaveoutput, \octaveimages and the environment octaveinput. Their effect is as follows (see also the JMmtex reference):

1. \octaveinput, octaveinput (environment):

Creates an input field for the octave code. Both the command and the environment have two mandatory arguments which specify the width and height of the input field. If the environment is used, its content becomes the initial content of the input field. The \octaveinput command creates an input field without initial content.

2. \octavebutton:

Creates a button to execute the Octave code. Has one optional argument, which specifies the button label. If omitted, a default label is used. The default label
is internationalized; its value is the translation of "Execute" in the respective language. To internationalize custom labels, use a \lang switch in the optional argument.

3. \ocatveoutput:

Creates a text field for the Octave output. Has two mandatory arguments which specify the width and height of the text field.

4. \octaveimages:

If the Octave code contains plot commands, the images emerging from the plots are inserted at the position specified by this command. If the command is omitted, plot images are not shown on the web page.

Example

Here is an example:

\title{Ovtave Demo}

\begin{octaveinput}{80}{10}
a11 = 1/4;
a12 = 2/3;
a21 = -1/5;
a22 = 3/5;
A = [ a11, a12; a21, a22 ];
A
\end{octaveinput}

\octavebutton

\octaveoutput{80}{10}

The page looks initially as follows:

If the "Execute" button is clicked, the result from Octave shows up in the output field:

If we expect plot commands to occur in the Octave code, we have to add the \ocatveimages command somewhere in the TeX source to see the results of plotting. For example:

\title{Octave Demo}

\begin{octaveinput}{80}{5}
tx = ty = linspace (-8, 8, 41)';
[xx, yy] = meshgrid (tx, ty);
r = sqrt (xx .^ 2 + yy .^ 2) + eps;
tz = sin (r) ./ r;
mesh (tx, ty, tz);
\end{octaveinput}

\octavebutton

\octaveoutput{80}{2}

\octaveimages

(The Octave code is taken from the Octave manual)

If the "Execute" button is clicked, the plot image shows up below the output field (which is empty his time because the Octave code doesn't produce any output this time):

Octave Problems

To create an Octave Problem see: OctaveProblems

screenshot_octave_01.png (13.3 KB) Tilman Rassy, 02/26/2014 12:05 PM

screenshot_octave_02.png (15.7 KB) Tilman Rassy, 02/26/2014 12:05 PM

screenshot_octave_01.png (20.6 KB) Tilman Rassy, 02/26/2014 12:11 PM

screenshot_octave_02.png (23.7 KB) Tilman Rassy, 02/26/2014 12:11 PM

screenshot_octave_03.png (126 KB) Tilman Rassy, 02/26/2014 12:34 PM

Screenshot_octave_01 Screenshot_octave_02 Screenshot_octave_01 Screenshot_octave_02 Screenshot_octave_03
Add picture from clipboard (Maximum size: 500 MB)