10-08-2013 03:32 PM
Had no success in finding something that I could modify for my purpose, so hopefully someone else can help. Still somewhat new to LabView, so some more obvious things are still sliding past my notice.
Long story short, I just need to be able to look at a 1D array of points (let's say [0.2222,0.3333, 0.4444, 0.6666, 0.7777, 0.8888, 1.0000], though it will normally be perhaps 100 - 500 points long) and ask whether or not there is a number between a range (let's say 0.5 - 0.8) and return the index of each point that does fall in that range to be used for some other purpose.
What might be the most efficient way to accomplish this?
Thanks greatly!
Solved! Go to Solution.
10-08-2013 03:35 PM
Feed the Array into In Range and Coerce and you'll get an array of booleans that are in Range. Then you can search that 1D array for the True values and get their indices.
10-08-2013 03:43 PM
Conditional tunnels, one of the nicer bits of syntactic sugar added to LV in a while:
Best in LV13+, but still not too shabby in LV12.
10-08-2013 04:33 PM
Unfortunately I have LV11, but the general idea got me there. Thanks!
12-29-2013 06:50 PM
Hi!
Is there similar solution for the 1D graph and indices - upper/lower limit ... please see the code ?!
I would need the range +/- 5% from certain value and indices from array ...
Thanx!
Vasco
12-29-2013 07:55 PM - edited 12-29-2013 07:56 PM
@VASCO-1 wrote:
Is there similar solution for the 1D graph and indices - upper/lower limit ... please see the code ?!
I don't see any 1D graph in your code. Please explain what you want.
So you want to keep certain elements and their array indices. Is the output supposed to be a 2D array?
What are you trying to show with the two independent code parts (upper and lower). Please explain.
(The upper code is completely pointless and broken. The shift regsiter belongs on the outer loop boundary and the inner FOR loop is not needed. Why is the front panel and diagram maximised to the screen?? Why do you use a local variable instead of simply branching the wire.)
Also, since the current thread is already marked as solved, you should probably have started a new thread.
12-29-2013 08:44 PM
Hi!
Sorry for being short with the data and explanation.
Basicly I would need to extract the data from the XY graph - at 3 different points with indices.
This would help me to explain the system properties.
So - I have settled value and what is the indices (time) at which this value is achieved ?!
Upper code is useles - I did not found the solution how to do it ?!
Thanx!
Vasco