So I am doing some code for my mechanics class. He typically gives us code to add to or edit. The code that was given was for a spring-mass problem using equations derived from position depedent force, that has the solved analytic equations done for us. Which plots a nice mechanical energy plot with kinetic, potential, force, and total energy. My problem arrises with my portion of the code, I know from my workspace that despite me using the Euler-Cromer numerical approach, my numbers match almost exactly to the analytics, and they should. However, the plotting for my portion of the code just comes up as flat lines. I can't not find any reasoning for it. It is almost as if it's assuming its not a function at all, despite having "y" and "x" values.
title('Spring-Mass Simple Harmonic Energy-Force Relation')
ylabel('PE, KE, E, F');