From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Index matrix to sparse matrix... saving memory
Date: Mon, 14 Jun 2010 06:07:03 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 8
Message-ID: <hv4gu7$ark$>
References: <htrfev$fo7$> <htrk32$2vm$> <htrlad$in3$> <htrmbl$nn6$> <hts2hl$3tk$> <htt9rq$1s8$> <htthum$sg$> <httk3s$hb0$> <httl5l$ns3$> <hum6no$7rt$> <hum8vg$65s$> <huo80j$c5n$> <huoa7s$dt4$> <hup2ps$rmb$> <huqb73$q0d$> <hurcjs$h31$> <hurdpc$5ln$> <hureus$mfm$> <hurg2g$5kt$> <hv2qti$j1l$> <hv3vug$ar0$>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1276495623 11124 (14 Jun 2010 06:07:03 GMT)
NNTP-Posting-Date: Mon, 14 Jun 2010 06:07:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: comp.soft-sys.matlab:644651

Take a look at example 10 of the doc of accumarray:

In this example, the function handle "@(x) {x}" is used to group the "values" as cell per bin.

With something similar you can accomplish the task you want.