title: Matlab hist function for image data
body: <p>I'm new to Matlab and I want to make  my own function that makes the same job as imhist(Displays histogram of image data) but I am a total newbie to this and I don't have any clues how I'm going to develop such function..
  I started making something but its very incomplete.</p>
  
  <pre><code>function [ output_args ] = myhist( x )
  %MYHIST Summary of this function goes here
  %Detailed explanation goes here
  
  x=imread('flower.jpg');
  
  imshow(x);
  
  [c,d]=hist(x(:),0:1:255);
  figure,plot(d,c);
  figure,plot(c,d);
  
  %figure,imhist(x);
   end
  </code></pre>
  
  <p>I would be very grateful if you could give me any helpful tips..</p>