CoCalc Public Filessupport / 2016-02-23-matlab.ipynb
Author: William A. Stein
Description: Jupyter notebook support/2015-06-04-141749-bokeh.ipynb
In [3]:
a = [1 2 3 4 6 4 3 4 5]

a = 1 2 3 4 6 4 3 4 5
In [4]:
b = a + 2

b = 3 4 5 6 8 6 5 6 7
In [5]:
plot(b)
grid on

In [6]:
bar(b)
xlabel('Sample #')
ylabel('Pounds')

In [7]:
plot(b,'*')
axis([0 10 0 10])

In [8]:
A = [1 2 0; 2 5 -1; 4 10 -1]

A = 1 2 0 2 5 -1 4 10 -1
In [9]:
B = A'

B = 1 2 4 2 5 10 0 -1 -1
In [10]:
C = A * B

C = 5 12 24 12 30 59 24 59 117
In [11]:
C = A .* B

C = 1 4 0 4 25 -10 0 -10 1
In [12]:
b = [1;3;5]
x = A\b

b = 1 3 5 x = 1 -0 -1
In [13]:
r = A*x - b

r = 0 0 0
In [14]:
eig(A)

ans = 3.73205 0.26795 1.00000
In [15]:
svd(A)

ans = 12.31706 0.51490 0.15768
In [16]:
p = round(poly(A))

p = 1 -5 5 -1
In [17]:
roots(p)

ans = 3.73205 1.00000 0.26795
In [18]:
q = conv(p,p)

q = 1 -10 35 -52 35 -10 1
In [19]:
r = conv(p,q)
plot(r);

r = 1 -15 90 -278 480 -480 278 -90 15 -1
In [20]:
whos

Variables in the current scope: Attr Name Size Bytes Class ==== ==== ==== ===== ===== A 3x3 72 double B 3x3 72 double C 3x3 72 double _fig 1x1 8 double _figHandles 1x1 8 double _filename 1x27 27 char _handle 1x1 8 double a 1x9 72 double ans 3x1 24 double b 3x1 24 double p 1x4 32 double q 1x7 56 double r 1x10 80 double theta 1x6284 24 double x 3x1 24 double Total is 6380 elements using 603 bytes
In [21]:
A

A = 1 2 0 2 5 -1 4 10 -1
In [22]:
sqrt(-1)

ans = 0 + 1i
In [ ]: