Nov-22-2018, 02:55 PM
(Nov-22-2018, 07:49 AM)Gribouillis Wrote: Can you explain the context? Are you trying to translate a matlab book into python? Is this homework?No,rather it is a challenge that I proposed, look at something that I have been able to do.
import matplotlib.pyplot as plt import numpy as np #------------------ ni = 10 a = -0.5 b = np.zeros(ni+1) n = np.arange(ni+1) y0 = 1 x0 = 0 x = np.zeros(ni+1) y = np.zeros(n+1) y[0] = y0 #---------------- #for i in range(y0-1,ni+1): ---> |perfect 0 to 10 # y[i] = a + b[i]+ n[i] + x[i] + x_0 + y_0 |this part I can not interpret it #markerline, stemlines, baseline = plt.stem(x, y, '-.') # setting property of baseline with color red and linewidth 2 #plt.setp(baseline, color='r', linewidth=2) #plt.show()