title: Save frequency data of histogram in Matlab
body: <p>I have two data set that been read from a txt file.
  I plot two histogram as picture below.
  How can i get and save the frequency data of this histogram? (i checked at the workspace, but no frequency values)</p>
  
  <p>Note:
  X-Axis are values from txt file
  Y-Axis are the frequency</p>
  
  <p><a href="https://i.stack.imgur.com/BPEu3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BPEu3.png" alt="enter image description here"></a></p>
  
  <p>The coding of above histogram plot.</p>
  
  <pre><code>clear;
  clc;
  
  filename = 'DistanceValue1.txt';
  filename1 = 'DistanceValue2.txt';
  A = importdata(filename);
  B = importdata(filename1);
  
  
  h1 = histogram (A,50);
  hold on
  h2 = histogram (B,50);
  hold off
  </code></pre>