LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

display every 5th element of the array

Solved!
Go to solution

Hello,

 

I am trying to take a for loop iteration and pull out every 5th element of data. This will eventually go to comparison of some type to activate a true/false case structure.

 

What I am having difficulty with is getting the algorithm down. I have attached a simple for loop that has a constant of 100 attached to the "N" terminal with a random number generator multiplied by 100, sending that through the for loop to give an array on the other side.

 

I will continue to rack my brain to see if I can solve this, but I have spent the better part of the morning trying to figure, and search this out, and have come up with nothing.

 

See attached vi.

0 Kudos
Message 1 of 12
(3,448 Views)

Decimate array resized for five outputs?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 12
(3,445 Views)

You can use a couple of different methods to do this.  Have a look at the Decimate 1D Array and Quotient & Remainder functions.  I have attached a modifed version of your code.

 

Dan

0 Kudos
Message 3 of 12
(3,444 Views)
Solution
Accepted by topic author M Boat
Message 4 of 12
(3,443 Views)

Maybe I was confusing in the initial post.

 

I am trying to use the iteration of the for loop to pull out every 5th element of the array. I am not even sure how to use the decimate array function.

0 Kudos
Message 5 of 12
(3,436 Views)

Have you looked at my modified code?

Dan

0 Kudos
Message 6 of 12
(3,427 Views)

yes, it seems to work. 🙂 I am working on some indexing issues of where it starts in my data. I will post up a screen shot here shortly.

0 Kudos
Message 7 of 12
(3,422 Views)

Can you use this method. It was that Ben suggested I think

 

 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 8 of 12
(3,416 Views)

Maybe something like this?

 

0 Kudos
Message 9 of 12
(3,407 Views)

Here are some images of my code that your solution went into. I would just post the vi's, but my project has a gazillion vi's to it to run, and I am limited to 3 attachments. See below.

 

Like I said, it seems to be working but, I am having some indexing issues. Also, the lines that start out with "0.000" are supposed to be blank. Basically everywhere there is 0.000, I am trying to make go away. The data I need to be there is every multiple of 5, ie: 5,10, 15, 20, etc.. until it gets to the end of the data file.

Download All
0 Kudos
Message 10 of 12
(3,402 Views)