‘I need to get 10 lines for each variable.’
This implies that one (or more) parameters must be varied 10 times and then integrated for each new set of parameters. The way to do that is to define the variables that need to change, then use a for loop to change them, and then run the integration in each iteration of the loop, with different parameter values (or combinations of values,depending on what the assignment requires). It would be easiest to save the outputs (‘y’ here) in a cell array to make the indexing easier. Then separate out the individual results after all the integrations are complete.
This will be easier if ‘tspan’ is a vector of more than two elements, for example —
tspan = linspace(0, 100, 50);
This sets all the outputs to the same length and the same times, making plotting them against the same time vector easier.
I would use one subplot for each variable, setting the xlim and ylim properties the same for all the subplot plots.
.


