im trying to solve the task starting on page 9 with method 2 http://www.math.ucla.edu/~baker/149.1.02w/handouts/dd_splines.pdf
My code:
import numpy as np
from numpy.linalg import inv
s0=[1,-1]
s1=[-1,2]
s2=[1,4]
s3=[4,3]
s4=[7,5]
M=inv(np.array([[4,1,0],[1,4,1],[0,1,4]]))
C=np.array([(np.dot(6,s1)-s0), np.dot(6,s2),(np.dot(6,s3)-s4) ])
print np.dot(M*C)
Traceback (most recent call last): File "C:/Users/john/Desktop/testint.py", line 16, in print np.dot(M*C) ValueError: operands could not be broadcast together with shapes (3,3) (3,2)
So my simple question is how is this done in correct way?