Path: news.mathworks.com!not-for-mail
From: "us " <us@neurol.unizh.ch>
Newsgroups: comp.soft-sys.matlab
Subject: Re: histogram in matlab
Date: Thu, 9 Aug 2007 22:45:10 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 24
Message-ID: <f9g5dm$jui$1@fred.mathworks.com>
References: <f9g34v$hi8$1@fred.mathworks.com>
Reply-To: "us " <us@neurol.unizh.ch>
NNTP-Posting-Host: webapp-00-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1186699510 20434 172.30.248.35 (9 Aug 2007 22:45:10 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 9 Aug 2007 22:45:10 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:423289


huda nawaf
<SNIP it's all in the language...

> What is the function that I can use to compute the gray 
level histogram in Matlab...

a hint:

     help histc;

% an image
     img=uint8(floor(256*rand(50,50)));
% the engine
     n=histc(img(:),0:255);
% the result
     subplot(2,1,1);
     image(img);
     axis image;
     colormap(gray(256));
     subplot(2,1,2);
     stem(n);
     set(gca,'xlim',[0,255]);

us