09-15-2010 02:10 PM
Hi,
I have an 3D array with 2x?x12 elements. The idea is passed into a loop and are filled with rows with measurement data, either to page 0 or page 1 in the array depending of which instrument the data is read from. The rows contains exactly the same amount of data for each iteration.
However, my problem is how can I insert a single row into my 3D array, choosing the page to insert it?
09-15-2010 02:19 PM
Each page of the array will have the same number of rows and columns. They cannot be different.
So, start by initializing an array as large or larger than the largest possible amount of data you expect to collect. Set the value to NaN or some other value which will never occur in your measurements. Initialize a shift register with this array. On each iteration use Replace Array Subset to put the new data into the desired row. You may need to have a shift register which keeps track of the row index for each page.
When you are finished with the data collection any array element with the initial value can be ignored as it does not contain measured data.
This method avoids problems with memory allocations which may be required by any technique which causes the array to grow.
Lynn