Skip to content

Instantly share code, notes, and snippets.

@tommyct614
Created February 23, 2018 04:34
Show Gist options
  • Save tommyct614/a2a1c6f2f056090ba1bc17c726be01d7 to your computer and use it in GitHub Desktop.
Save tommyct614/a2a1c6f2f056090ba1bc17c726be01d7 to your computer and use it in GitHub Desktop.
code to generate sine values from 0 to pi/2
import numpy as np
x = np.linspace(0,np.pi/2, 100)
y = np.zeros(len(x))
x1 = np.zeros(100)
for i in range(len(x)):
y[i] = np.sin(x[i])
print(y)
np.savetxt("inputData.dat", np.c_[x,y], fmt = "%.3e")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment