Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Histogram
Date: Sun, 8 Nov 2009 09:22:02 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 13
Message-ID: <hd62jq$l64$1@fred.mathworks.com>
References: <hd4fgs$t35$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257672122 21700 172.30.248.37 (8 Nov 2009 09:22:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 8 Nov 2009 09:22:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:583305


Try this:

x = (1:1:11)';
u = [2 3.5 4 5 6 5 4 4 3 2 1]';
umin = min(u);
umax = max(u);
edge = linspace(umin,umax,numel(x))';

%
[k bin]=histc(u,edge);
u2=sort(edge(bin),'descend')'

% Bruno