03-09-2011 11:25 AM
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.
Solved! Go to Solution.
03-09-2011 11:34 AM
Decimate array resized for five outputs?
Ben
03-09-2011 11:36 AM
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
03-09-2011 11:36 AM
Here is the code
03-09-2011 11:42 AM
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.
03-09-2011 12:00 PM
Have you looked at my modified code?
Dan
03-09-2011 12:10 PM
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.
03-09-2011 12:15 PM
Can you use this method. It was that Ben suggested I think
03-09-2011 12:24 PM - edited 03-09-2011 12:24 PM
03-09-2011 12:28 PM
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.