cat does not convert sparse matrices?
Francesco Potorti`
Potorti at isti.cnr.it
Sat Sep 13 08:24:54 CDT 2008
>> octave> a=zeros(3,3,0);
>> octave> b1=zeros(3,3);
>> octave> whos a b1
>>
>> Prot Name Size Bytes Class
>> ==== ==== ==== ===== =====
>> rwd a 3x3x0 0 double
>> rwd b1 3x3 72 double
>>
>> octave> size(cat(3,a,b1))
>> ans =
>>
>> 3 3 1
>
>Trailing singleton dimensions should be dropped
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?
--
Francesco Potortì (ricercatore) Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR Fax: +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa Email: Potorti at isti.cnr.it
(entrance 20, 1st floor, room C71) Web: http://fly.isti.cnr.it/
More information about the Help-octave
mailing list