05-10-2009 05:42 PM - edited 05-10-2009 05:43 PM
LSASS wrote:I am usind the Array subset to split my huge 1D array in to chunks of 8. But I am unsure as to what to pass in to the index input of the Array subset function. When I put it in a for loop, the index continuously changes. So what do I input?
Split it into what? Please show us your code so we have a better idea.
The index is zero at the first interation and increases by one for each later iteration. Multiply it by 8 and wire to the index input and set the size to 8 and you get the next eight elements per iteration.
As has been mentioned before, "reshape array" is probably the better tool.
05-10-2009 09:05 PM - edited 05-10-2009 09:05 PM
LSASS wrote:Hello smercurio,
I am usind the Array subset to split my huge 1D array in to chunks of 8. But I am unsure as to what to pass in to the index input of the Array subset function. When I put it in a for loop, the index continuously changes. So what do I input?
You input the next multiple of 8, based on the current iteration value. When iteration = 0, the value you input is 0. When iteration = 1, you input 8. When iteration = 2, you input 16. When ...
The Reshape Array method would not require this since the for-loop can be auto-indexed from the resultant 2D array.
05-11-2009 02:50 AM
Hi
I think use property node,i am not conform , try it.........
Regards
Munna
05-11-2009 09:04 AM
hello lsass,
i don't know if your sequence can be present more than one time or if your data are double or not or are
exactly the same.
Here is a suggestion
Regards
Tinnitus
05-11-2009 09:33 AM
LSASS wrote:[...]I have a problem: I have a huge 1D array and I need to split it in to sets of 8 elements as need to compare these 8 elements with another 1 D array of size 8. [...]
Well, coming a little late into this discussion...but reading this sentence sounds like a pattern match to me. Maybe this is better in regard to performance than to split the array and do the comparison afterwords.....
just my 5 cents,
Norbert
05-11-2009 11:26 AM
Smercurio
Great Idea for decimation
LSASS is what you are looking for?
05-11-2009 11:29 AM
05-11-2009 11:31 AM
Thanks ! that is a cool feature
05-11-2009 12:07 PM
hello,
you could also swap 0 and 1 reshape entries and replace number to decimate command with
size of sequence looked (3) , it will avoid to use a transpose array function.
regards
Tinnitus
05-11-2009 12:31 PM
Tinnitus I have to dissagree with your method to eliminate the transpose array
In this example the number of "Channels" = the number that you wish to decimate by which = 4
and there are 3 samples for each channel
applying your proposed changes does not yield the same dataset (you can not simply change the number to decimate from 4 to 3) because the array size of the match pattern is how many samples not channels
the only way i can think of to eliminate the transpose array is to index the array manually instead of using the autoindex