This file contains 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
%Get started by opening MATLAB and clicking "New Script" then paste this code in the script window. | |
% Run the code by clicking "Run" in the editor tab. | |
%In MATLAB, comments are marked with percent signs instead of # (hash signs) or """ | |
%(triple quotes). | |
%Code that is saved in a file and performs some actions is called a script. | |
%MATLAB scripts are saved with the suffix .m | |
%Assignment is still done with an equals sign and linspace works basically |
This file contains 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 numpy as np | |
import matplotlib.pyplot as plt | |
import random | |
def openckdfile(): | |
glucose, hemoglobin, classification = np.loadtxt('ckd.csv', delimiter=',', skiprows=1, unpack=True) | |
return glucose, hemoglobin, classification | |
This file contains 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 sympy as sym | |
import math | |
def title(s): | |
print("\n") | |
print("*******") | |
print(s) | |
title("Square Root of 9") | |
print("Math: " + str(math.sqrt(9))) |
This file contains 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
""" | |
Created on Wed Apr 10 13:27:17 2019 | |
@author: jenncross | |
""" | |
import numpy as np | |
This file contains 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
""" | |
Created on Mon Apr 8 12:32:37 2019 | |
@author: jenncross | |
""" | |
import imageio | |
from scipy import ndimage | |
import matplotlib.pyplot as plt | |
import numpy as np |
This file contains 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 numpy as np | |
import matplotlib.pyplot as plt | |
import scipy.signal as sig | |
x = np.linspace(1,100,200) | |
error = (np.random.normal(size=200))*1000 #generate random errror centered at 0 | |
This file contains 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 random | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
import dice # My custom module | |
rollsums = testSums(1, 100) | |
This file contains 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 random | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
def rolldice(number): | |
rolls = np.zeros((number,), int) | |
for i in range(number): | |
die = random.randint(1,6) | |
rolls[i] = die |
This file contains 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 numpy as np | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
fin = open("balloon.csv") | |
data = [] | |
for line in fin: | |
data.append(float(line[1:6])) |
NewerOlder