title: Difference between using : in assignment and in for-loop
body: <p>I wrote a simple for loop:</p>
  
  <pre><code>&gt;&gt; for m=1:3
  p=m;
  end
  &gt;&gt; whos
    Name       Size                   Bytes  Class
  
    m          1x1                        8  double array
    p          1x1                        8  double array
  </code></pre>
  
  <p>But when I try to create a data type of same class for a range and check what variables you now have stored its not of 1x1 size:</p>
  
  <pre><code>&gt;&gt; k=1:256;
  
  &gt;&gt; whos
    Name       Size                   Bytes  Class
  
    k          1x256                   2048  double array
    m          1x1                        8  double array
    p          1x1                        8  double array
  </code></pre>
  
  <p>Why there is a difference in-between the variables sizes of m and k? If I understand correctly 1x1 size(variable 'm') means that it is a matrix of 1x1 order. So why k becomes 1x256 order?</p>