%load_ext oct2py.ipython
%%octave
p = [-2, -1, 0, 1, 2]
polyout(p, 'x')
[[-2. -1. 0. 1. 2.]]
%octave plot([1 2 3], [4 5 6])
5.0
import numpy as np
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:
%octave -i Z mean(Z)
5.0
5.0
%octave -o W W = Z * mean(Z)
W = 5 20 25 50
5.0
W
array([[ 5, 20, 25, 50]])
The size and format of output plots can be specified:
%%octave -s 600,800 -f svg
plot([1, 2, 3]);