cat does not convert sparse matrices?

dbateman at fladenmuller.org dbateman at fladenmuller.org
Sun Sep 14 08:17:54 CDT 2008


On Sat, Sep 13, 2008 at 03:24:54PM +0200, Francesco Potorti` wrote:
> Should they really be?  This is the first step of a loop where I build a
> 3d matrix by catenating 2d matrices on the 3rd dim, like this:
> 
> a=zeros(3,3,0);
> for z=1:Z
>     b=rand(3,3);
>     a=cat(3,a,b);
> endfor
> 
> if cat() dropped the trailing singleton dimension, would this loop keep
> working?


They are automatically added again if needed, as if they weren't 
something like

cat (3, rand(2,2), rand(2,2))

would not work either

D.


More information about the Help-octave mailing list