You can create a vector t
for time starting from 0 to 3 seconds at a fixed interval of 0.05 seconds using the 0:0.05:3
syntax. Then you can calculate the corresponding force
vector based on your equation of motion, let's say force = sin(t)
.
Here's the code:
main.m59 chars3 lines
This will create a vector force
that stores the force from 0 to 3 seconds at fixed intervals of 0.05 seconds, where the force values are calculated using the sin
function.
You can replace the sin
function with your own equation of motion to calculate the force.
gistlibby LogSnag