##// END OF EJS Templates
Add inline figures for octavemagic example notebook.
Add inline figures for octavemagic example notebook.

File last commit:

r7453:199aa715
r7453:199aa715
Show More
octavemagic_extension.ipynb
272 lines | 145.2 KiB | text/plain | TextLexer
/ docs / examples / notebooks / octavemagic_extension.ipynb
InĀ [9]:
%load_ext octavemagic
InĀ [10]:
x = %octave [1 2; 3 4];
x
Out[10]:
array([[ 1.,  2.],
       [ 3.,  4.]])
InĀ [11]:
a = [1, 2, 3]

%octave_push a
%octave a = a * 2;
%octave_pull a
a
Out[11]:
array([[2, 4, 6]])
InĀ [12]:
%%octave -i x -o y
y = x + 3;
InĀ [13]:
y
Out[13]:
array([[ 4.,  5.],
       [ 6.,  7.]])
InĀ [14]:
%%octave -f svg

p = [12 -2.5 -8 -0.1 8];
x = 0:0.01:1;

polyout(p, 'x')
plot(x, polyval(p, x));
12*x^4 - 2.5*x^3 - 8*x^2 - 0.1*x^1 + 8
No description has been provided for this image
InĀ [15]:
%%octave -s 500,500

# butterworth filter, order 2, cutoff pi/2 radians
b = [0.292893218813452  0.585786437626905  0.292893218813452];
a = [1  0  0.171572875253810];
freqz(b, a, 32);
No description has been provided for this image
InĀ [16]:
%%octave -s 600,200 -f png

subplot(121);
[x, y] = meshgrid(0:0.1:3);
r = sin(x - 0.5).^2 + cos(y - 0.5).^2;
surf(x, y, r);

subplot(122);
sombrero()
No description has been provided for this image
InĀ [16]: