[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: splitting 1 large row into multiple rows
From: |
Francesco Potortì |
Subject: |
Re: splitting 1 large row into multiple rows |
Date: |
Tue, 25 Oct 2011 10:23:42 +0200 |
>I was worried about that; I've got my system crunching data right now and so
>am relying on memory. Try
>
>a = reshape(tmp, 3, 2)';
Yes, reshape fills the target matrix by column, so if you want it filled
by row, you should ask for three *rows* and then transpose the results:
octave> tmp = [540 6.28319 0 538.3 6.26573 0]
tmp =
540.00000 6.28319 0.00000 538.30000 6.26573 0.00000
octave> a = reshape(tmp, 3, [])'
a =
540.00000 6.28319 0.00000
538.30000 6.26573 0.00000
--
Francesco Potortì (ricercatore) Voice: +39.050.315.3058 (op.2111)
ISTI - Area della ricerca CNR Mobile: +39.348.8283.107
via G. Moruzzi 1, I-56124 Pisa Fax: +39.050.315.2040
(entrance 20, 1st floor, room C71) Web: http://fly.isti.cnr.it