contoh snippet dari yayo arellano


import numpy as np
import matplotlib.pyplot as plt


def f1(x):
    return 2*(1-x) 
def f2(x):
    return 0 


x = np.linspace(-5,5,1000)
y = np.piecewise(x,[(x>0)*(x<1),(x≤0)*(x≥1)],[f1,f2])


plt.figure(figsize =(8,6))
plt.plot(x,y)

Bang Kus

Too Much Ado About Nothing -Anonymous

Lebih baru Lebih lama

Formulir Kontak