07-31-2018 07:59 AM
Hello, I currently have an array. A set of X-values and 3 different Y-values for each of those X-values. I am needing to take the average of those 3 Y-values of each X-value, not all the Y-values in my data and spit back out the information containing the X-value along with the average of the 3 Y-values.
Solved! Go to Solution.
07-31-2018 08:10 AM
Have you tried writing out (pencil and paper, only) a flow-chart or "scheme" to solve this problem, starting with a text file that appears of have lines consisting of text representing 4 numbers/line? Here's an example:
Obviously, you now need to translate this pencil/paper "program" into LabVIEW. This will involve (a) file I/O of text data, (b) parsing text data to create arrays of numbers, (c) working with array to return mean, (d) looping and creating array(s) from values arising from each loop iteration. These are all fairly simple LabVIEW concepts that should be covered in the many Learning LabVIEW Tutorials (including the ones listed on the first page of this Forum). The best part of all is that by doing this yourself instead of having one of us do it for you, you will learn LabVIEW.
Bob Schor
07-31-2018 08:12 AM
First read the file with the Read Delimited Spreadsheet to give you a 2D array of doubles. Then wire that into a FOR loop. Inside the loop, you are just dealing with a row. So use Delete From Array with 0 wired to the element (length left unwired). You can now do a Mean with the remaining array and autoindex that value out of the loop, resulting an array of averages.
07-31-2018 08:35 AM
Hi. It's exacly as said in the post before mine :(snippet attached)