From: Rachel on 9 Feb 2010 05:01 I have two matrices, one of which is data taken at 1 hz, the other which is taken at 64hz, and neither of them have anything in common except for they start at the same time and end at the same time (only one actually HAS time) I need two elements from the shorter file for each of the records in the longer file and so far my thinking is basic: copy each row 64 times and then join the matrices. simple. except for i can't think of a way to do it quickly. has anyone got any ideas, or preferably solutions? The 64 hz file is full of velocity values, the 1 hz file has the pitch and roll information of the experiment. thanks in advance Rachel
From: Ashish Uthama on 9 Feb 2010 08:33 On Tue, 09 Feb 2010 05:01:02 -0500, Rachel <rhnaeco(a)geemale.com> wrote: > I have two matrices, one of which is data taken at 1 hz, the other which > is taken at 64hz, and neither of them have anything in common except for > they start at the same time and end at the same time (only one actually > HAS time) > > I need two elements from the shorter file for each of the records in the > longer file and so far my thinking is basic: copy each row 64 times and > then join the matrices. simple. except for i can't think of a way to do > it quickly. > > has anyone got any ideas, or preferably solutions? > > The 64 hz file is full of velocity values, the 1 hz file has the pitch > and roll information of the experiment. > > thanks in advance > > Rachel Something like this? >> singles=1:5 singles = 1 2 3 4 5 >> reps=repmat(singles,[4,1]) reps = 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 >> mults=reps(:)' mults = Columns 1 through 13 1 1 1 1 2 2 2 2 3 3 3 3 4 Columns 14 through 20 4 4 4 5 5 5 5
From: Rachel on 12 Feb 2010 05:53 yes! thanks "Ashish Uthama" <first.last(a)mathworks.com> wrote in message <op.u7u3x9c1a5ziv5(a)uthamaa.dhcp.mathworks.com>... > On Tue, 09 Feb 2010 05:01:02 -0500, Rachel <rhnaeco(a)geemale.com> wrote: > > > I have two matrices, one of which is data taken at 1 hz, the other which > > is taken at 64hz, and neither of them have anything in common except for > > they start at the same time and end at the same time (only one actually > > HAS time) > > > > I need two elements from the shorter file for each of the records in the > > longer file and so far my thinking is basic: copy each row 64 times and > > then join the matrices. simple. except for i can't think of a way to do > > it quickly. > > > > has anyone got any ideas, or preferably solutions? > > > > The 64 hz file is full of velocity values, the 1 hz file has the pitch > > and roll information of the experiment. > > > > thanks in advance > > > > Rachel > > Something like this? > > > >> singles=1:5 > > singles = > > 1 2 3 4 5 > > >> reps=repmat(singles,[4,1]) > > reps = > > 1 2 3 4 5 > 1 2 3 4 5 > 1 2 3 4 5 > 1 2 3 4 5 > > >> mults=reps(:)' > > mults = > > Columns 1 through 13 > > 1 1 1 1 2 2 2 2 3 3 3 > 3 4 > > Columns 14 through 20 > > 4 4 4 5 5 5 5
|
Pages: 1 Prev: actxcontrol and export to Word, Excel and Powerpoint Next: fuzzy |