11-18-2014 10:54 AM - edited 11-18-2014 11:21 AM
I have two arrays such as these
Array 1 Array 2
a 1
a 5 a
b 2 b
c 3 f
d 4 g
e 5 h
f 6
g 7
g 10
h 8
h 9/
with what i have now i can create an array that lists the matching elements
Results:
a 1
b 2
f 6
g 7
h 8
However, it does not record both sets of a,g, and h, only the first instance. Anyone know how to fix this problem?
Any help is appreciated
Solved! Go to Solution.
11-18-2014 11:19 AM - edited 11-18-2014 11:20 AM
Drat posted to the wrong thread
11-18-2014 11:33 AM
OpenG has a search function that returns an array of all occurrences, not just the first one. That, and a For loop, solves your problem. If you don't wish to install OpenG, you can make your own function that loops through a 1D array and returns all of the hits.
11-18-2014 11:37 AM
So if i dont install open g how would i do this?
Thank you
11-18-2014 11:40 AM - edited 11-18-2014 11:45 AM
A FOR loop inside of another FOR loop should do the trick. Have the outer loop autoindex on the search parameters and the inner loop autoindex on the search array. On a match, add that item to the list.
11-18-2014 11:45 AM
Im not sure what your saying, sorry. im pretty new to labview.
11-18-2014 11:47 AM
@rmarks12 wrote:
Im not sure what your saying, sorry. im pretty new to labview.
I just added an image to my previous post to show what I mean.
11-18-2014 11:52 AM
You're the best! Thanks so much for your help!
11-18-2014 01:17 PM
@rmarks12 wrote:
im pretty new to labview.
That's okay we were all new at some point. If you have an question about a function in particular you can open the context help (CTRL + H) and over over a function to learn more. Also here is some free training if you are interested.
6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training
With questions on anything else, feel free to do what you are already doing, post here on the forums.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
01-02-2015 03:33 PM
Hi, is there anyway you can post this except for labview 2013??? I can't open your 2014