title: MATLAB: For loop structure
body: <p>This is a basic program but since I'm new to MATLAB, I'm not able to figure out the solution. </p>
  
  <p>I have a column vector "Time" in which I want to print value "1" in first 147 cells, followed by "2" in 148 to 2*147 cells and so on. For that, I have written the following script:</p>
  
  <pre><code> Trial&gt;&gt; c=1;
   Trial&gt;&gt; k=0;
   Trial&gt;&gt; for i = c:146+c
              Time(i,1)=1+k;
              c=i;
              k=k+1;
              end
  </code></pre>
  
  <p>I know I need to iterate the loop over "Time(i,1)=1+k;" before it executes the next statement. I tried using break but that's not supposed to work. Can anyone suggest me the solution to get the desired results?(It was quite simple in C with just the use of curly braces.)</p>