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 13:26:01 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 23
Message-ID: <gv8th9$166$1@fred.mathworks.com>
References: <gv8nju$kvn$1@fred.mathworks.com> <gv8r4e$19v$1@fred.mathworks.com> <gv8rum$lea$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 1243085161 1222 172.30.248.35 (23 May 2009 13:26:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 23 May 2009 13:26:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:541993


"Bruno Luong"
> Humm it is clearer but not perfect, because why this doesn't work:
> >> a={1}
> a = 
>     [1]
> >> class(a)
> ans =
> cell
> >> a(1)=2
> ??? Conversion to cell from double is not possible.
> 
> I'm still confused. It seems the example I gave above Matlab succeeds to convert somehow double to cell? Why now it can't...

well,
in your first case, ML knows nothing about the content of the container during execution and simply converts all its entries (=within container) according to some (published) rules...

http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_prog/br04cfa-1.html

in your second case, ML knows the class of the lhs and tells you that it cannot add another class (=between containers)

somehow, this all makes sense (to me)...
:-)
urs