LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

delete all odd index



Ravens Fan wrote:
Decimate seems to be about twice as fast.

Actually, your example is highly flawed! 😮
  1. You need to place the indicators after the sequence structure, because there is a chance that the asynchronous update of the first indicator might grab CPU away from the second calculation.
  2. The much more damaging flaw is the wire branch that you seem to benchmark inside the decimate case.

Once you move that wire branch and indicators outside the frame, the decimate solution is probably about 1000x faster!!!!!!! (It will show 0ms, even with a 1e7 sized input).

Try it!
 


Message Edited by altenbach on 03-03-2008 12:43 PM
Message 11 of 30
(1,575 Views)
how about deleting from a global array?
would that use the same approach?
decimate 1d array?

p.s--also, can you show me up to post images on the forum as well

Best regards,
Krispiekream
0 Kudos
Message 12 of 30
(1,566 Views)


krispiekream wrote:
how about deleting from a global array?

Sorry, can you be more specific what you mean by that?
 
(To embed images, attach them first, then edit your post and insert an image link to the attachment. Don't embed images that are more than about 800 pixels wide!)
Message 13 of 30
(1,561 Views)
 was wonderiing if i have a set of array in global array. my array skip data on every other two data... for instant. element 0 = sn 441295 element 1 = no data element 3 = sn 498989 element 4 - no data... how can i delete from my array all the data that doesn't exist? thanks


Message Edited by krispiekream on 03-03-2008 03:26 PM
Best regards,
Krispiekream
0 Kudos
Message 14 of 30
(1,554 Views)

krisp:

Is it possible to not put every other element in there in the first place?  Stands to reason that would be more efficient than any other solution.

Rob

Message 15 of 30
(1,549 Views)
Well, you operate on a global array by first reading it into your code, decimating it, then writing the modified array back to the global.
 
I agree with Rob though, maybe you should filter it before and make sure the global never even receives the inflated data in the first place. 😉
 
Where is the data coming from?
Message 16 of 30
(1,544 Views)


altenbach wrote:

Actually, your example is highly flawed! 😮
  1. You need to place the indicators after the sequence structure, because there is a chance that the asynchronous update of the first indicator might grab CPU away from the second calculation.
  2. The much more damaging flaw is the wire branch that you seem to benchmark inside the decimate case.

Once you move that wire branch and indicators outside the frame, the decimate solution is probably about 1000x faster!!!!!!! (It will show 0ms, even with a 1e7 sized input).

Try it!
 


Message Edited by altenbach on 03-03-2008 12:43 PM

I just knew there would be something about the way the flat sequence was structured you would trip me up on!Smiley Very Happy
 
I played around with variations of your modifications.  I think the branching in the decimate frame was the biggest contributor in time to the decimate case.  Taking your modifications, I got about 60 msec for 1e7 array for reshape and 0 for decimate case.  Pentium D 3.4GHz.
 
I knew I would learn something by contributing to this thread.


Message Edited by Ravens Fan on 03-03-2008 05:00 PM
Message 17 of 30
(1,532 Views)

here is my code, how do i filter my global array?

i been trying to figure this out for 1 week and cant seems to get it right...

can someone please help...

i want to delete odd elements from my global array..

 

Best regards,
Krispiekream
0 Kudos
Message 18 of 30
(1,492 Views)
First.  Way too many local variables and overuse of the stacked sequence structure.
 
Which array is the one you want to eliminate the alternate indices of?  Is it "ContantsArray"?  (spelling?)  Where in the program do you want to do it?
 
Just Read the global variable, pass it through one of the methods above, put it back into the global variable.
Message 19 of 30
(1,489 Views)
You did not attach any of the subVIs or globals and the entire VI is very difficult to read. One thing for sure though is that nowhere in the top level is the decimate array function like you were told to use. Is this is a subVI or did you decide to ignore the advice and do something different?
Message 20 of 30
(1,487 Views)