On May 2, 2006, at 10:39 AM, David Bateman wrote:
Paul Kienzle wrote:
On May 2, 2006, at 7:25 AM, David Bateman wrote:
John, do you want mat2cell committed as well?
mat2cell is a core function and it works like expected so the answer
should be yes.
Yes, but I commit nothing without Johns say so.
Agreed. My comment was for John.
%!test
%! x = 'abcdefghij';
%! c = mat2cell(x,1,[0,4,2,0,4,0]);
%! assert(c,{'','abcd','ef','','ghij',''})
Yes but in matlab size('c{1} is [1,0]!!! So it is the test that is in
fact wrong. The resize function I recently added might be used here
to change the test to
%!
assert(c,{resize('',1,0),'abcd',ef',resize('',1,0),'ghij',resize('',1,0)})
Hmmm... is this bug for bug compatibility? What do the following do:
cell2mat({'','abcd','ef','','gh'})
cell2mat(mat2cell('abcdefgh',1,[0,4,2,0,2]))