Path: news.mathworks.com!not-for-mail
From: "AP Pal" <avispal@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Data Bin
Date: Mon, 5 Oct 2009 22:12:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 22
Message-ID: <hadqvj$t0f$1@fred.mathworks.com>
References: <haafq5$mvs$1@fred.mathworks.com> <had81v$f9l$1@fred.mathworks.com> <hadjaf$pn1$1@fred.mathworks.com>
Reply-To: "AP Pal" <avispal@gmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1254780723 29711 172.30.248.35 (5 Oct 2009 22:12:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 5 Oct 2009 22:12:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2020759
Xref: news.mathworks.com comp.soft-sys.matlab:575137


Thanks a lot Jan .. you rock!!
now only if some one answers in my other thread to add listbox i will be set( for the time being) :P


"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <hadjaf$pn1$1@fred.mathworks.com>...
> Dear AP Pal!
> 
> > Any fast way to reshape the whole matrix?
> > i mean converting from 100X 50
> > to                               10X  50
> > 
> > by averaging the 10  rows at a time to bin
> > 
> > the reshape funtion worked for n X 1 matrix only.
> 
> No, RESHAPE works really fast for any array, not just for [n x 1] matrices!
> 
> The mentioned solution is efficient. A little bit faster, because it avoids the overhead of calling the function MEAN:
>   X = rand(100, 50);
>   Y = sum(reshape(X, 10, 10, 50), 1) / 10;
> 
> Kind regards, Jan