Vectorized Function

[Solved] Vectorized Function | Scala - Code Explorer | yomemimo.com
Question : vectorized function

Answered by : antonio-cota-rodrguez

import numpy as np
import matplotlib.pyplot as plt
import math
def teo_function(d): return 2*math.pi*math.sqrt(((1**2)/(12+d**2))/9.81*d)
vecfunc = np.vectorize(teo_function)
d = np.arange(0.0, 100.0, 0.01)
T = vecfunc(d)
plt.plot (d, T, 'bo', d, T, 'k')
plt.show()

Source : https://stackoverflow.com/questions/38138417/trying-to-plot-a-defined-function | Last Update : Sat, 25 Jun 22

Answers related to vectorized function

Code Explorer Popular Question For Scala