In [3]:
%load_ext oct2py.ipython
In [6]:
%%octave 
p = [-2, -1, 0, 1, 2]
polyout(p, 'x')
[[-2. -1.  0.  1.  2.]]
In [16]:
%octave plot([1 2 3], [4 5 6])
Out[16]:
5.0
In [8]:
import numpy as np
In [9]:
Z = np.array([1, 4, 5, 10])

Objects can be passed back and forth between Octave and IPython via the -i and -o flags in line:

In [10]:
 %octave -i Z mean(Z)
5.0
Out[10]:
5.0
In [11]:
%octave -o W W = Z * mean(Z)
W =

   5  20  25  50
Out[11]:
5.0
In [12]:
W
Out[12]:
array([[ 5, 20, 25, 50]])

The size and format of output plots can be specified:

In [14]:
%%octave -s 600,800 -f svg
    plot([1, 2, 3]);
Produced by GNUPLOT 4.2 patchlevel 6 1 1.5 2 2.5 3 1 1.5 2 2.5 3