From: Kyle on 11 May 2010 13:16 Hello, I have several data files that are all discrete parts of the same sample space and I need to concatenate them all into one big array. For example, we might have the following two files: data1.dat: 1 1 2 2 3 3 4 4 5 5 data2.dat 6 6 7 7 8 8 9 9 10 10 and I need to import them into matlab into a variable that will have the value 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 now, I can easily import each one separately using importdata, on each one, but then i have two variables. How can I combine them into one?
From: Sean on 11 May 2010 13:44 "Kyle " <kbrig035(a)uottawa.ca> wrote in message <hsc3co$id0$1(a)fred.mathworks.com>... > Hello, > > I have several data files that are all discrete parts of the same sample space and I need to concatenate them all into one big array. For example, we might have the following two files: > > data1.dat: > 1 1 > 2 2 > 3 3 > 4 4 > 5 5 > > data2.dat > 6 6 > 7 7 > 8 8 > 9 9 > 10 10 > > and I need to import them into matlab into a variable that will have the value > > 1 1 > 2 2 > 3 3 > 4 4 > 5 5 > 6 6 > 7 7 > 8 8 > 9 9 > 10 10 > > > now, I can easily import each one separately using importdata, on each one, but then i have two variables. How can I combine them into one? >>datatotal = [data1; data2]; %Note the semi colon that's the vertical concatenation operator
From: Kyle on 11 May 2010 13:49 "Sean " <sean.dewolski(a)nospamplease.umit.maine.edu> wrote in message <hsc516$3g7$1(a)fred.mathworks.com>... > "Kyle " <kbrig035(a)uottawa.ca> wrote in message <hsc3co$id0$1(a)fred.mathworks.com>... > > Hello, > > > > I have several data files that are all discrete parts of the same sample space and I need to concatenate them all into one big array. For example, we might have the following two files: > > > > data1.dat: > > 1 1 > > 2 2 > > 3 3 > > 4 4 > > 5 5 > > > > data2.dat > > 6 6 > > 7 7 > > 8 8 > > 9 9 > > 10 10 > > > > and I need to import them into matlab into a variable that will have the value > > > > 1 1 > > 2 2 > > 3 3 > > 4 4 > > 5 5 > > 6 6 > > 7 7 > > 8 8 > > 9 9 > > 10 10 > > > > > > now, I can easily import each one separately using importdata, on each one, but then i have two variables. How can I combine them into one? > > > >>datatotal = [data1; data2]; %Note the semi colon that's the vertical concatenation operator Thank you, and how about horizontal concatenation?
From: Godzilla on 11 May 2010 22:47 "Kyle " <kbrig035(a)uottawa.ca> wrote in message <hsc5b0$mee$1(a)fred.mathworks.com>... > "Sean " <sean.dewolski(a)nospamplease.umit.maine.edu> wrote in message <hsc516$3g7$1(a)fred.mathworks.com>... > > "Kyle " <kbrig035(a)uottawa.ca> wrote in message <hsc3co$id0$1(a)fred.mathworks.com>... > > > Hello, > > > > > > I have several data files that are all discrete parts of the same sample space and I need to concatenate them all into one big array. For example, we might have the following two files: > > > > > > data1.dat: > > > 1 1 > > > 2 2 > > > 3 3 > > > 4 4 > > > 5 5 > > > > > > data2.dat > > > 6 6 > > > 7 7 > > > 8 8 > > > 9 9 > > > 10 10 > > > > > > and I need to import them into matlab into a variable that will have the value > > > > > > 1 1 > > > 2 2 > > > 3 3 > > > 4 4 > > > 5 5 > > > 6 6 > > > 7 7 > > > 8 8 > > > 9 9 > > > 10 10 > > > > > > > > > now, I can easily import each one separately using importdata, on each one, but then i have two variables. How can I combine them into one? > > > > > > >>datatotal = [data1; data2]; %Note the semi colon that's the vertical concatenation operator > > > > Thank you, and how about horizontal concatenation? [data1 data2] but only if the number of rows is the same in each file
|
Pages: 1 Prev: why mvnrnd works with a singular covariance matrix Next: Jacket toolbox for MATLAB on GPU |