Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: combining arrays
Date: Sat, 2 Oct 2010 22:41:04 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 11
Message-ID: <i88cdv$pll$1@fred.mathworks.com>
References: <i882sb$hfj$1@fred.mathworks.com> <i88774$oh7$1@fred.mathworks.com> <i88bhr$6a$1@fred.mathworks.com> <i88bv0$po9$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1286059264 26293 172.30.248.38 (2 Oct 2010 22:41:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 2 Oct 2010 22:41:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:675355

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <i88bv0$po9$1@fred.mathworks.com>...
> PS to post#4, Using directly SPARSE is more readable:
> 
> m=max(A1(end),A2(end))
> A12 = find(sparse(A1,1,true,m,1)+ sparse(A2,1,true,m,1))
> 
> Bruno

PS again: actually I don't know what kind of complexity i.e., O(n) or O(n*log(n), when SPARSE is invoked with the input indexes that are already sorted. 

Bruno