Skip to content

Instantly share code, notes, and snippets.

@sangheestyle
Last active August 29, 2015 14:07
Show Gist options
  • Save sangheestyle/4b9132a8edaa69a125e5 to your computer and use it in GitHub Desktop.
Save sangheestyle/4b9132a8edaa69a125e5 to your computer and use it in GitHub Desktop.
ps3
import csv
with open('ps03-4.csv','rb') as file:
contents = csv.reader(file)
matrix = list()
for row in contents:
matrix.append(row)
import scipy.io
mat = scipy.io.loadmat('PS03_results_final.mat')
import pickle
f = open("PS3_4.pik", "wb")
pickle.dump(summary, f)
f.close()
import pickle
f = open("PS3_4.pik")
summary = pickle.load(f)
from pylab import *
from numpy import *
def plot_graph(v1, v2, xl, yl, dot="k.", grid_type=True):
plot(v1, v2, dot)
xlabel(xl)
ylabel(yl)
grid(grid_type)
show()
if __name__=="__main__":
t = linspace(-4, 4, 100)
y = sin(t) + randn(len(t))*0.1
plot_graph(t, y, xl="Time", yl="Value")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment