title: horizontal-vertical only lines
body: <p>I'm new in matlab. I have a block of image as illustrated below:
  <a href="https://i.stack.imgur.com/3W2qb.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3W2qb.jpg" alt="enter image description here"></a></p>
  
  <p>Whites show pixel that their values are equal to <code>1</code> and Blacks show pixel that their values are equal to <code>0</code>,</p>
  
  <p>I want to get <code>vertical only lines</code>. This means horizontal lines should be removed as illustrated below: </p>
  
  <p><a href="https://i.stack.imgur.com/8gvd8.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8gvd8.jpg" alt="enter image description here"></a></p>
  
  <p>Also I want to get <code>horizontal only lines</code>. This means vertical lines should be removed as illustrated below:</p>
  
  <p><a href="https://i.stack.imgur.com/Baflm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Baflm.jpg" alt="enter image description here"></a></p>
  
  <p>How can I do it in <code>Matlab</code>? I prefer morphological operations for this.</p>