title: Using fprintf to print on several lines in Matlab
body: <p>Question:
  Write a procedure called Print7 to print all integer numbers within the range 0:100 that are divisible by 7. Ten numbers are to be printed on one output line. Hence write a  program that invokes that procedure.</p>
  
  <p>This is what I did</p>
  
  <pre><code> file = fopen('print7.dat','r');
  
   x = 1:100
  
   for x=[1:100]
     if mod(x,7) == 0;
      print7 = [x]
   end
  end
   fprintf('print7 %d\n', print7)
  </code></pre>
  
  <p>Now it's output becomes the number 98 - which I understand to be the largest number under 100 divisible by 7. But I want a 10xn matrix-like result.</p>
  
  <p>What do I do?</p>