MATLAB Fundamentals>Specialized Data Types>Working with Dates and Times>(3/5) Applying Functions to Datetimes>附加练习
任务:
There is also data from Manchester City in the workspace,?manCity
. You can sort it, find the cumulative points, and then plot it over the Manchester United data to see how the teams compared over the season. Don't forget to issue the?hold?on
?and?hold?off
?commands to add a plot to the current data.
解决:
manCity
manCity = sortrows(manCity,"GameTime")
ptsTotmC = cumsum(manCity.Points)
hold on
plot(manCity.GameTime,ptsTotmC)
hold off
结果: