Using the passive sign convention, the voltage across a device is v (t) = 240 cos (314t) V and the current through the device is i (t) = 4 sin (314t)A.
Using MATLAB, create a short script (m-file) to assign a value to the time variable, t, and then calculate the voltage, current, and power at that time.
Run the script for t = 5 ms and t = 10 ms, and for each result state whether the device is absorbing or delivering power.