In [1]:
%load_ext rpy2.ipython
In [2]:
%matplotlib inline
In [3]:
%%R
library(lattice)
attach(mtcars)
# scatterplot matrix
splom(mtcars[c(1,3,4,5,6)], main="MTCARS Data")
In [4]:
%load_ext oct2py.ipython
In [5]:
%%octave
A = reshape(1:4,2,2);
b = [36; 88];
A\b
[L,U,P] = lu(A)
[Q,R] = qr(A)
[V,D] = eig(A)
In [8]:
%%octave
xgv = -1.5:0.1:1.5;
ygv = -3:0.1:3;
[X,Y] = ndgrid(xgv,ygv);
V = exp(-(X.^2 + Y.^2));
surf(X,Y,V)
title('Gridded Data Set', 'fontweight','b');
In [ ]: