Path: news.mathworks.com!not-for-mail
From: "Steven_Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: accumarray issue (not working with large numbers?)
Date: Mon, 26 Aug 2013 10:41:39 -0400
Organization: MathWorks
Lines: 28
Message-ID: <kvfpf3$pj7$1@newscl01ah.mathworks.com>
References: <kv8u3t$esp$1@newscl01ah.mathworks.com> <kvaf3h$4nl$1@newscl01ah.mathworks.com>
NNTP-Posting-Host: ah-slord.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain;
	format=flowed;
	charset="UTF-8";
	reply-type=response
Content-Transfer-Encoding: 7bit
X-Trace: newscl01ah.mathworks.com 1377528099 26215 172.28.147.189 (26 Aug 2013 14:41:39 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 26 Aug 2013 14:41:39 +0000 (UTC)
In-Reply-To: <kvaf3h$4nl$1@newscl01ah.mathworks.com>
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726
Xref: news.mathworks.com comp.soft-sys.matlab:801464



"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message 
news:kvaf3h$4nl$1@newscl01ah.mathworks.com...
> "Larry Rose" <larryrose.rose843@gmail.com> wrote in message 
> <kv8u3t$esp$1@newscl01ah.mathworks.com>...

*snip*

> The error message is pretty clear: unless your B(:,1) fully covers integer 
> from 1, 2 ..., to max(B(:,1)), you'll get different dimensions between 
> accumarray and unique outputs. So you won't be able to concatenate them.

As a concrete example of what Bruno said:

accumarray(2, 3, [], @prod) % returns [0; 3] since nothing's assigning a 
value to the first element
unique(2) % returns 2

[2, [0; 3]] % errors since you can't concatenate horizontally something with 
1 row and something with 2 rows.

-- 
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on 
http://www.mathworks.com