I'm new to Matlab and I'm trying to plot the velocity related to the function for a damped harmonic oscillator. I have been able to plot the function itself, but when I try to plot the velocity of said function, I receive this error:
Error using plot
Vectors must be the same length.
Error in damped_oscillator (line 102)
plot(t,v);
I'm not sure how to solve this problem. I've linked the original code. Any help is much appreciated!
Best Answer