import numpy as np
def Vin(t):
inputs = []
for i in range (1000):
if (-1)**(np.floor( 2 * t[i] )) == 1:
Vin = (1)
inputs.append(Vin)
else:
Vin = (-1)
inputs.append(Vin)
return inputs
when I use this function on a range of t
values, I only get one result,
i.e.
input1=Vin(tpoints)
print (input1)
only gives [1], whereas I want the function to do it for every t
value.