# splitting 1 large row into multiple rows

6 messages
Open this post in threaded view
|

## splitting 1 large row into multiple rows

 I have 1 large row with hundreds of columns in an array in octave ``````example of a row:  540 6.28319 0 538.3 6.26573 0 `````` I would like it to look like this. Every 3rd column move data to next row. ``````540 6.28319 0 538.3 6.26573 0 `````` How can I go about doing this? Thanks-- _______________________________________________ Help-octave mailing list [hidden email] https://mailman.cae.wisc.edu/listinfo/help-octave
Open this post in threaded view
|

## Re: splitting 1 large row into multiple rows

 Try reshape.   tmp = [540 6.28319 0 538.3 6.26573 0]; a = reshape(tmp, 2, 3); -Ron On Mon, Oct 24, 2011 at 3:54 PM, Rick T wrote: I have 1 large row with hundreds of columns in an array in octave``````example of a row:  540 6.28319 0 538.3 6.26573 0 `````` I would like it to look like this. Every 3rd column move data to next row.``````540 6.28319 0 538.3 6.26573 0 `````` How can I go about doing this?  Thanks -- _______________________________________________Help-octave mailing list[hidden email]https://mailman.cae.wisc.edu/listinfo/help-octave _______________________________________________ Help-octave mailing list [hidden email] https://mailman.cae.wisc.edu/listinfo/help-octave
Open this post in threaded view
|

## Re: splitting 1 large row into multiple rows

 Thanks for the quick response but that creates 540 0 6.265736.28319 538.3 0instead of (which I'm trying to get)``````540 6.28319 0 538.3 6.26573 0````````` `````I did try ````````tmp = [540 6.28319 0 538.3 6.26573 0]; a = reshape(tmp, [], 3); ````````to get the other columns but it's just not giving me what I want which is ````` ```540 6.28319 0 538.3 6.26573 0``````On Mon, Oct 24, 2011 at 1:05 PM, Ron Crummett wrote: Try reshape.   tmp = [540 6.28319 0 538.3 6.26573 0]; a = reshape(tmp, 2, 3); -Ron On Mon, Oct 24, 2011 at 3:54 PM, Rick T wrote: I have 1 large row with hundreds of columns in an array in octave``````example of a row:  540 6.28319 0 538.3 6.26573 0 `````` I would like it to look like this. Every 3rd column move data to next row.``````540 6.28319 0 538.3 6.26573 0 `````` How can I go about doing this?  Thanks -- _______________________________________________Help-octave mailing list[hidden email] https://mailman.cae.wisc.edu/listinfo/help-octave -- _______________________________________________ Help-octave mailing list [hidden email] https://mailman.cae.wisc.edu/listinfo/help-octave
Open this post in threaded view
|

## Re: splitting 1 large row into multiple rows

 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)';   -Ron On Mon, Oct 24, 2011 at 4:31 PM, Rick T wrote: Thanks for the quick response but that creates  540 0 6.26573 6.28319 538.3 0 instead of (which I'm trying to get) ``````540 6.28319 0 538.3 6.26573 0````````I did try ````````tmp = [540 6.28319 0 538.3 6.26573 0]; a = reshape(tmp, [], 3); ````````to get the other columns but it's just not giving me what I want which is `` ``````540 6.28319 0 538.3 6.26573 0`````` On Mon, Oct 24, 2011 at 1:05 PM, Ron Crummett wrote: Try reshape.   tmp = [540 6.28319 0 538.3 6.26573 0]; a = reshape(tmp, 2, 3); -Ron On Mon, Oct 24, 2011 at 3:54 PM, Rick T wrote: I have 1 large row with hundreds of columns in an array in octave``````example of a row:  540 6.28319 0 538.3 6.26573 0 `````` I would like it to look like this. Every 3rd column move data to next row.``````540 6.28319 0 538.3 6.26573 0 `````` How can I go about doing this?  Thanks -- _______________________________________________Help-octave mailing list[hidden email] https://mailman.cae.wisc.edu/listinfo/help-octave -- _______________________________________________Help-octave mailing list[hidden email]https://mailman.cae.wisc.edu/listinfo/help-octave _______________________________________________ Help-octave mailing list [hidden email] https://mailman.cae.wisc.edu/listinfo/help-octave
 In reply to this post by Ron Crummett-2 thanksOn Mon, Oct 24, 2011 at 2:40 PM, Ron Crummett wrote: 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)';   -Ron On Mon, Oct 24, 2011 at 4:31 PM, Rick T wrote: Thanks for the quick response but that creates  540 0 6.26573 6.28319 538.3 0 instead of (which I'm trying to get) ``````540 6.28319 0 538.3 6.26573 0````````I did try ````````tmp = [540 6.28319 0 538.3 6.26573 0]; a = reshape(tmp, [], 3); ````````to get the other columns but it's just not giving me what I want which is `` ``````540 6.28319 0 538.3 6.26573 0`````` On Mon, Oct 24, 2011 at 1:05 PM, Ron Crummett wrote: Try reshape.   tmp = [540 6.28319 0 538.3 6.26573 0]; a = reshape(tmp, 2, 3); -Ron On Mon, Oct 24, 2011 at 3:54 PM, Rick T wrote: I have 1 large row with hundreds of columns in an array in octave``````example of a row:  540 6.28319 0 538.3 6.26573 0 `````` I would like it to look like this. Every 3rd column move data to next row.``````540 6.28319 0 538.3 6.26573 0 `````` How can I go about doing this?  Thanks -- _______________________________________________Help-octave mailing list[hidden email] https://mailman.cae.wisc.edu/listinfo/help-octave -- _______________________________________________Help-octave mailing list[hidden email]https://mailman.cae.wisc.edu/listinfo/help-octave -- _______________________________________________ Help-octave mailing list [hidden email] https://mailman.cae.wisc.edu/listinfo/help-octave