Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!news.glorb.com!news.litech.org!News.Dal.Ca!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: matlab random object
Date: Fri, 11 Jul 2008 19:26:00 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 25
Message-ID: <g58c48$cfa$1@canopus.cc.umanitoba.ca>
References: <g57qt2$s1s$1@fred.mathworks.com> <g584c3$17v$1@canopus.cc.umanitoba.ca> <g5892p$9q7$1@fred.mathworks.com> <gaOdk.10360$LG4.6975@nlpi065.nbdc.sbc.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1215804360 12778 192.70.172.160 (11 Jul 2008 19:26:00 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Fri, 11 Jul 2008 19:26:00 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:478915



In article <gaOdk.10360$LG4.6975@nlpi065.nbdc.sbc.com>,
Dave Bell  <dbell@TheSPAMFREEBells.net> wrote:
>ching l wrote:

>> and what is {:} means?

>"All elements in this dimension"

Not quite.

If you have an array A, then A(:) means the same as reshape(A,[],1)
-- that is, the values of A all considered together as a single column
vector. This is not the same as A(1:end) or A(1:length(A))
as those forms will result in a row vector if A is not a column vector.

Similarily, if C is a multidimensional cell array, C{:} means
the same as forming a comma seperated list of all the contents
of the cell column array reshape(C,[],1)

The "All elements in this dimension" meaning only applies if
at least two dimensions are given in the indexing. For example,
A(:,:) is the same shape as A, but A(:) is always a column vector.
-- 
  "The quirks and arbitrariness we observe force us to the
  conclusion that ours is not the only universe." -- Walter Kistler