LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

splitting arrays

Solved!
Go to solution
Highlighted

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.

Message Edited by altenbach on 05-10-2009 03:43 PM

LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 11 of 23
(787 Views)
Highlighted

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. 

Message Edited by smercurio_fc on 05-10-2009 09:05 PM
Message 12 of 23
(771 Views)
Highlighted

Hi

 

   I think use  property node,i am not conform , try it.........

 

 

 

 

Regards

Munna

0 Kudos
Message 13 of 23
(754 Views)
Highlighted

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

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 14 of 23
(739 Views)
Highlighted

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 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 15 of 23
(732 Views)
Highlighted

Smercurio

 

Great Idea for decimation

 

 

LSASS is what you are looking for?

- James

Using LV 2012 on Windows 7 64 bit
Message 16 of 23
(716 Views)
Highlighted
James, you can eliminate the "AND array elements" by setting the comparison mode to "compare aggregates".

LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Message 17 of 23
(712 Views)
Highlighted

Thanks !  that is a cool feature

- James

Using LV 2012 on Windows 7 64 bit
0 Kudos
Message 18 of 23
(709 Views)
Highlighted

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

 

 

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 19 of 23
(687 Views)
Highlighted

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

 

- James

Using LV 2012 on Windows 7 64 bit
Message 20 of 23
(679 Views)