title: Extracting a banded matrix from a dense matrix in MATLAB
body: <p>I have a large dense matrix, say matrix A of size 10000 by 10000 and I need to extract a banded matrix of bandwidth say 10 from it, i.e., </p>
  
  <p>B(i,j) = A(i,j) if |i-j| &lt;=10</p>
  
  <p>B(i,j) = 0 otherwise</p>
  
  <p>What is the most efficient way to go about doing this in MATLAB?</p>