06-18-2013 04:57 AM
A surface profilometer we use produces data in text files with five columns with data point ordering by row first; i.e. if you have the following data sample;
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
Then the data order follows the number order here. I want to chop up this annoying format into multiple arrays by row (depending on the number of rows = for loop?) then splice them back together as a single column (transpose these arrays then build array?). Help!
Solved! Go to Solution.
06-18-2013 05:13 AM
06-18-2013 05:20 AM
You've just described one solution. Autoindexing will take into account the number of rows present - you could easily build the for loop by taking the array size and feeding the number of rows to it, but autoindexing does this for you.
06-18-2013 05:23 AM
That's the other solution I'd thought of - find the array size of the input array, index array twice to find row and column sizes, then feed in as the dimension for Reshape Array.
06-18-2013 11:10 AM
Are you asking how to take a 2-D array and transpose it? If so, I recommend using the Transpose 2D Array function found on the Array Palette. [I'm sure you already thought of that, which means that I don't understand your problem ...].
06-18-2013 11:19 AM - edited 06-18-2013 11:20 AM
@apg504 wrote:
A surface profilometer we use produces data in text files with five columns with data point ordering by row first; i.e. if you have the following data sample;
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
Then the data order follows the number order here. I want to chop up this annoying format into multiple arrays by row (depending on the number of rows = for loop?) then splice them back together as a single column (transpose these arrays then build array?). Help!
Once you have a 1D array, the concept of rows and columns no longer exists.
In any case, reshaping is the right thing. Here's what I would do: