Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.fr>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Bug in mat2cell?
Date: Mon, 26 Nov 2007 09:04:29 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 31
Message-ID: <fie26t$7ro$1@ginger.mathworks.com>
References: <fibjt3$64b$1@fred.mathworks.com> <fibp2d$sff$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.fr>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: ginger.mathworks.com 1196067869 8056 172.30.248.37 (26 Nov 2007 09:04:29 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 26 Nov 2007 09:04:29 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:439335



"Bruno Luong" <brunoluong@yahoo.com> wrote in message
<fibp2d$sff$1@fred.mathworks.com>...
> I look at the Mathworks's mat2cell code, and at the line
> #198, the array ref is updated under certain condition:
> 
> ...
> if (inc~=1) && ~(cellsize(1)==1)
>     [ref{1:inc-1}] = deal(refstart{1:inc-1});
>     refstatic(1:inc-1) = 0;
> end
> ...
> 
> The condition ~(cellsize(1)==1) seems to cause the Bug. If I
> remove it from the test, as following:
> 
> ...
> if (inc~=1)
>     [ref{1:inc-1}] = deal(refstart{1:inc-1});
>     refstatic(1:inc-1) = 0;
> end
> ...
> 

Ditto, the test ~(cellsize(1)==1) is removed from the source
code of mat2cell in R2007b.

It seems to be a right fix for customer who still own older
version of MATLAB. I would expect Mathwork would react to my
question, but they seem to ignore it.

Bruno