Showing results for 
Search instead for 
Did you mean: 

Search 1D array doesn't works.

Go to solution
Accepted by topic author Fird

Another option would be to see if the absolute difference is below a certain threshold. (see image marked in green)



Your code has quite a few very inefficient constructs, for example

  • to go from a 2D array to a 1D array, you would use "index array" and not convert to dynamic data and back. remove the built array inside the lower right corner loop and the means array will be 1D to begin with. Change the indicator accordingly to a 1D array.
  • You also make excessive overuse of local variables. Never read a local variable inside a tight loop unless you expect it to change during the execution of the loop. As an example, look for your use of the "elements" locals. Delete them and wire from the terminal! (see image in blue)
  • After you search for the index, you use "array subset" in the pressure trace, but "delete from array" for the alpha array. Since you delete zero elements, the function has no purpose.
  • You code is much more complicated than it has to be. I am sure it could be done with half the code.
Message Edited by altenbach on 05-12-2009 08:31 AM
Message Edited by altenbach on 05-12-2009 08:36 AM
Message 11 of 14



I've done as you suggest. However, it still doesnt works where the index didnt select the real number as needed which is 0.0253858.



ps : refer attachment.

0 Kudos
Message 12 of 14

Then it doesn't exist in the array. Run the VI so that there is data in the indicators adn then go to Edit>Make Current Values Default. Save the VI. Post that.


You should also use the Include upper limit with the In Range function.

Message 13 of 14

Norbert, Dennis, and Altenbach,


I manage to solve the problem already using the method suggested by Altenbach.


Thanks a lot guys.



0 Kudos
Message 14 of 14