LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Split 1D array in "X" similar parts

Solved!
Go to solution

Hi everyone!

I'm new in this community and using labview too. Be patient with my english, I'm writing from Colombia and my english skills are not perfect Smiley LOL .

Well... I have 1D array with 220500 elements. I need to split this signal in "X" similar parts (if there are some element remaining, just ignore them). "X" will be a variable number (2, 3, 4, 5, 6...) in a loop.

For example: 1D array with 220500 elements, start splitting the array in 2 similar parts saving both parts (110250), after that, the same array with 220500 elements in 3 similar parts...

 

I don't know if my explanation is sufficient to understand my problem.

 

I will appreciate your tips, and thank you all! Smiley Happy

0 Kudos
Message 1 of 6
(2,425 Views)

And what is the exact problem you run into?

 

How do you want your output?

 

Post what you have, and tell us where you're stuck.

 

You'd typically use split array or get array subset or delete from array. Perhaps in a recursive VI, depending on the desired output.

0 Kudos
Message 2 of 6
(2,420 Views)

Im stuck in how to do the split.

When I try to do the split with "Split 1D Array" function, I get the two parts in two different arrays, fine, but I can't do that with 3, 4, 5 similar parts.

So, what is the correct and functional way to split 1D array in "X" similar parts?

 

0 Kudos
Message 3 of 6
(2,413 Views)

@VegaAlex wrote:

Im stuck in how to do the split.

When I try to do the split with "Split 1D Array" function, I get the two parts in two different arrays, fine, but I can't do that with 3, 4, 5 similar parts.

So, what is the correct and functional way to split 1D array in "X" similar parts?


Get the size, divide it by X. Round to -inf. Get that size floor(size/X) times. Probably in a for loop.

 

Again, the details depend on what you want to get as an output.

0 Kudos
Message 4 of 6
(2,397 Views)

It sounds like you should be using Reshape Array!

Message 5 of 6
(2,385 Views)
Solution
Accepted by topic author VegaAlex

pa.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 6 of 6
(2,376 Views)