Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Comma list with leading cell
Date: Sat, 23 May 2009 12:54:01 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 37
Message-ID: <gv8rl9$40f$1@fred.mathworks.com>
References: <gv8nju$kvn$1@fred.mathworks.com> <gv8r4e$19v$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1243083241 4111 172.30.248.35 (23 May 2009 12:54:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 23 May 2009 12:54:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:541986


"us " <us@neurol.unizh.ch> wrote in message <gv8r4e$19v$1@fred.mathworks.com>...
> "Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <gv8nju$kvn$1@fred.mathworks.com>...
> > This syntax works it is beyond my expectation! Is it documented somewhere?
> >  
> > >> [{} 1 2 3]
> > 
> > ans = 
> > 
> >     [1]    [2]    [3]
> > 
> > % To me the correct syntax is
> > 
> > >> [{} {1 2 3}]
> > 
> > Bruno
> 
> it is a weel known fact of ML life
> 
> ...
> When MATLAB sees a subscripted assignment to an existing variable, MATLAB checks the class of the right-hand-side against the class of the left-hand-side (LHS) variable. If different, it attempts to convert the right-hand-side (RHS) variable to the type of the LHS class.
> ...
> 
>      ['a' nan]
>      [uint8(1) pi]
>      [pi uint8(1)]
> 
> here some of the tech docs this is referred to
> 
> http://www.mathworks.com/support/solutions/en/data/1-6K5PAO/
> http://www.mathworks.com/support/solutions/en/data/1-6K5PAO/
> 
> us

btw, we've been using this sometimes to bypass NUM2CELL...
it seems a bit faster...

us