-1

So I'm just trying to produce a Simple graph but i keep getting a value error for some reason, code below

import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
time = np.linspace(0,2,500)
pi = np.pi
def y(t):
 np.cos((2*pi*10*t)+30)
plt.plot(time,y(time))
eoinc837
  • 1
  • 2

1 Answers1

0

I had completley forgotten to return the value from my function

working code:

time = np.linspace(0,2,500)
pi = np.pi
def y(t):
    value = np.cos((2*pi*10*t)+30)
    return value
plt.plot(time, y(time))
eoinc837
  • 1
  • 2