Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
restrepo
GitHub Repository: restrepo/ComputationalMethods
Path: blob/master/homework/homework_2018_1_08_1216730080.ipynb
934 views
Kernel: Python 3
from IPython.display import Math, Latex, HTML, Markdown, YouTubeVideo %pylab inline import numpy as np import matplotlib.pyplot as plt # JSAnimation import available at https://github.com/jakevdp/JSAnimation from JSAnimation import IPython_display from matplotlib import animation #Interpolation add-on import scipy.interpolate as interp import sympy x =sympy.Symbol('x') # declare analytical varibles sympy.init_printing() # Use LaTeX to print sympy obejects xrange=range def sprint(x): return sympy.Matrix(x) def augmneted(m,b): matrix=copy(m) sol=copy(b) A = np.concatenate((m,b.T),axis=1) return sprint(A)
Populating the interactive namespace from numpy and matplotlib
M=np.array([[1,2],[3,4]]) B=np.array([[5,6]])
sprint(M)
[1234]\left[\begin{matrix}1 & 2\\3 & 4\end{matrix}\right]
sprint(B)
[56]\left[\begin{matrix}5 & 6\end{matrix}\right]
augmneted(M,B)
[125346]\left[\begin{matrix}1 & 2 & 5\\3 & 4 & 6\end{matrix}\right]