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 14:12:01 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 35
Message-ID: <gv907h$jee$1@fred.mathworks.com>
References: <gv8nju$kvn$1@fred.mathworks.com> <gv8r4e$19v$1@fred.mathworks.com> <gv8rum$lea$1@fred.mathworks.com> <gv8th9$166$1@fred.mathworks.com> <gv8v05$355$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1243087921 19918 172.30.248.38 (23 May 2009 14:12:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 23 May 2009 14:12:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:542001


"Matt " <xys@whatever.com> wrote in message <gv8v05$355$1@fred.mathworks.com>...
> "us " <us@neurol.unizh.ch> wrote in message <gv8th9$166$1@fred.mathworks.com>...
> > "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
> 
> No, this page specifically gives a table of  5 data types for which mixed-type concatenation is valid. Type 'cell' is not among them

yes, but - like other logical/numeric/char data objects - it is an indexed(!) based container...

http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_prog/f2-47534.html

in contrast, just try

     [struct('a','a'),1,2]

again, this whole thing - always - made a lot of sense to me...
however, in a way i can also agree with you two well-known CSSM-syntax purists:
rather than implementing a array-construction-rule-for-unlike-data-objects, TMW might as well just have decided to error out by default if such a construct is encountered during runtime...

urs