Actually there are some errors in the code.
linspace is a function which defines a vector from a starting to end point with the specified interval.
And the above code plots x and sol , here sol is not defined ! It is inside the loop so it must be a moving plot. It has nothing to do with t.