title: Comparison of memory consumption between standard simulation of Brownian motion and Brownian bridge construction
body: <p>I want to plot the memory used on the Y-axis and time steps on the X-axis of the standard Brownian motion and the Brownian bridge construction on MATLAB. I cannot seem to find anything online in regards to this so I am a bit lost. Here is what my MATLAB code is for just the Brownian motion.</p>
  
  <pre><code>mu = .0125;
  sigma = .08;
  N = 200;
  displacement = normrnd(mu,sigma,N,N);
  x = cumsum(displacement);
  plot(x);
  ylabel('position');
  xlabel('time step');
  </code></pre>
  
  <p>This is what I want the plot to sort of look like:</p>
  
  <p><a href="https://i.stack.imgur.com/1L0ek.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1L0ek.jpg" alt="enter image description here"></a></p>