[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cat does not convert sparse matrices?
From: |
Francesco Potorti` |
Subject: |
Re: cat does not convert sparse matrices? |
Date: |
Sat, 13 Sep 2008 15:24:54 +0200 |
>> 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: address@hidden
(entrance 20, 1st floor, room C71) Web: http://fly.isti.cnr.it/