Contoh highlight code python import numpy as np import matplotlib.pyplot as plt # untuk menggunakan numpy.piecewise harus dibuat fungsi biasa dalam python. def g(x): return 2*(1-x) # untuk 0 < x < 1 def h(x): return 0 # untuk selainnya # Evaluasi fungsi g dan h secara bersamaan menggunakan numpy.piecewise hjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj x = np.linspace(-5,5,1000) y = np.piecewise(x,[(x =1)*(x Ini Contoh kodenya
Komentar
Posting Komentar