Last active
August 29, 2015 14:07
-
-
Save sangheestyle/4b9132a8edaa69a125e5 to your computer and use it in GitHub Desktop.
ps3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
with open('ps03-4.csv','rb') as file: | |
contents = csv.reader(file) | |
matrix = list() | |
for row in contents: | |
matrix.append(row) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scipy.io | |
mat = scipy.io.loadmat('PS03_results_final.mat') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pickle | |
f = open("PS3_4.pik", "wb") | |
pickle.dump(summary, f) | |
f.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pickle | |
f = open("PS3_4.pik") | |
summary = pickle.load(f) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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