03-05-2015 09:31 AM
Ive reviewed a few forums related to this question, but not exactly what i need.
I'm looking for a way to extract every nth element from a 1D array. The data in the array is very large so decimate function would not be helpful since i need to extract every 200th element from the array, and then build a new array with all of the extracted elements.
Any suggestions? Ive tried a few things and am feeling very stuck since none of them worked.
Solved! Go to Solution.
03-05-2015 09:35 AM
03-05-2015 09:41 AM
BowenM beat me to it.
Lynn
03-05-2015 09:42 AM - edited 03-05-2015 09:43 AM
03-05-2015 10:06 AM
Also Reshape Array, then use Index Array to get the row or column of interest.
03-05-2015 10:07 AM
Thanks for your fast repsonse, i believe this is what im looking for except it wont allow me to wire my array through the loop like you have, error: wire connected to an undirected tunnel appears.... any suggestions?
03-05-2015 10:11 AM
Thanks for your fast repsonse, i believe this is what im looking for except it wont allow me to wire my array through the loop like you have, error: wire connected to an undirected tunnel appears.... any suggestions?
03-05-2015 10:14 AM
never mind got it, thanks!!
03-05-2015 10:41 AM
I think that RavensFan's suggestion of using Reshape Array is usually the best for these kinds of operations. Note that when indexing you have to wire a zero into the columns index terminal, or the column indexing will be disabled.
Is there any better way to do a roof() function on the array and n?
03-05-2015 11:27 AM
@libbyherself wrote:
The data in the array is very large so decimate function would not be helpful since i need to extract every 200th element from the array, and then build a new array with all of the extracted elements.
It also really depends what kind of noise and frequencies are in the data and what the data reprensents. In the worst case, just taking every nth element might give you all kinds of alias frequencies, distorting your data. You might want to do some filtering. Even just taking the average of chunks of 200 points might give you cleaner, less noisy data. (example)