Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: obtain independent vectors of non zeros
Date: Tue, 18 Dec 2012 03:46:09 +0000 (UTC)
Organization: Citedi IPN
Lines: 14
Message-ID: <kaoou1$3uv$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-04-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1355802369 4063 172.30.248.35 (18 Dec 2012 03:46:09 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 18 Dec 2012 03:46:09 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2176596
Xref: news.mathworks.com comp.soft-sys.matlab:784984

How can I obtain cell array whenever I find a zero or zeros, for example: 

a=[16 17 32 0 0 63 79 80 0 0 0 113 0 129 130]

I want to obtain subsets of non zeros and their sum

a1={16 17 32 }  and their sum1= sum(a1)

a2={63 79 80}  and their sum2= sum(a2)

a3={113}  and their sum3= sum(a3)


a4={129 130 }  and their sum4= sum(a4)