Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!n39g2000hsh.googlegroups.com!not-for-mail
From:  Randy Poe <poespam-trap@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: big arrays with variable dimension sizes
Date: Mon, 17 Sep 2007 06:49:29 -0700
Organization: http://groups.google.com
Lines: 21
Message-ID: <1190036969.630744.316520@n39g2000hsh.googlegroups.com>
References: <fck27u$88o$1@fred.mathworks.com>
NNTP-Posting-Host: 192.35.37.20
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Trace: posting.google.com 1190036969 23842 127.0.0.1 (17 Sep 2007 13:49:29 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 17 Sep 2007 13:49:29 +0000 (UTC)
In-Reply-To: <fck27u$88o$1@fred.mathworks.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 squid.atl.lmco.com:3128 (squid/2.5.STABLE14)
Complaints-To: groups-abuse@google.com
Injection-Info: n39g2000hsh.googlegroups.com; posting-host=192.35.37.20;
Xref: news.mathworks.com comp.soft-sys.matlab:428884



On Sep 16, 4:04 pm, "David Doria" <daviddo...@gmail.com> wrote:
> I have a 4d array where sometimes dimension 3 is length 10
> and sometimes dimension 3 is length 200.
>
> When I do something like this:
>
> Normalized_Moment_Values(1, 1, :, :), I usually do
> squeeze(Normalized_Moment_Values(1, 1, :, :)) to give a
> civilized looking result.  However, in this case, i get
> something that is LEN x 200, and if it happens to be a time
> when it is only length 10, i get 190 rows of 0's.  Is there
> a better way to do this (to remove the 0's or even to store
> the whole thing so that it doesn't fill the rest with 0's?)?

I'm not clear if you're trying to fix a display problem
or a storage problem, but perhaps you want to look
into cell arrays, which can have elements of arbitrary
length (in fact, of arbitrary dimension or type).

            - Randy