Regarding the urgency of your question, I don't have any rush to generate the complete matlab code for "image segmentation using histogram specification". Indeed having worked in image processing for the best part of 40 years I have never heard of such a technique.

One thing I can tell you for future reference, expecting someone else to do your project based on a one line totally meaningless title is NOT the best way to get an urgent homework /project completed. The best way to get useful results out of this forum is as follows.

1) Provide a DETAILED description of what you are trying to accomplish, and what the algorithm you are trying to use. Your one liner is totally inadequate, making us on the receiving end think "if he cant be bothered to tell us what he is trying to do, why should we be bothered".

2) Explain where you are having problems, preferably include a segment of code that illustrates your problem.

In order to get us to help you, give us evidence that you have at least put in some effort to help yourself. As has been said many times in this forum, we are NOT a homework completion service.