%-----------------------------------------------------------------------------------
% See how long it takes to plot n points for Matlab. Set n to your favorite size,
% then let it rip. Beware: even if you clear all variables and close all graphics
% windows between runs, successive calls in the same Matlab session take about 1/4
% the time as the first one. So exit Matlab and restart it if you want to get
% something more like the upper bound.
%
% Run this by starting Matlab in your favorite way, then at the command prompt type
% the name of this script without the .m suffix:
%   >> checkplottime
%
% Increase/decrease the value of n to check for different data sizes.
%------------------------------------
% Started: Mon 16 Nov 2009, 04:34 PM
% Modified: Tue 24 Aug 2010, 06:32 PM
% Last Modified: Mon 29 Aug 2016, 10:00 AM
%-----------------------------------------------------------------------------------

n = 4000000;
x = linspace(-pi, pi, n);
y = sin(x);
% Matlab's tic/toc commands implement a delta timer. 
tic;
plot(x, y, 'b+');
drawnow
time = toc;
disp(['Plotting ' num2str(n/1e6) ' million data points takes ' ...
      num2str(time) ' seconds.' ])
