From Friday, January 17th 11 PM CDT (January 18th 5 AM UTC) through Saturday, January 18th 11:30 AM CDT (January 18th 5:30 PM UTC), ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting some part of 1-D array from 2-D array

Solved!
Go to solution

Hello. I am using Labview 2014 and need your help.

 

My purpose is to calculate average of some part in test data file. I did it very easily with Excel using such function of ‘=AVERAGE(D3:D5)’. To manipulate many test data files, I am trying to automate the process with Labview.

 

Would you please see my attachment image file and answer the questions?

  1. Using the For Loop and the Case Structure, I can extract some part of 1-D array from 2-D array, which I want (Column 4; Row 3 to Row 5). However, there is still unwanted elements of two zeros (Column 4; Row 1 and Row 2) and affect the average calculation. How can I eliminate the unwanted zero returns so that only wanted part (Column 4; Row 3 to Row 5) can be averaged?
  2. Do you know much simpler method other than my code, which can achieve my purpose?

 Attachment Image.jpg

 

0 Kudos
Message 1 of 5
(3,170 Views)
Solution
Accepted by converser26

Hi Conserver,

 

Yes there is a simplier way to do it. And it solves both your problems :

 

select-table.png

 

Then you just need to calculate the average of all the values in the output table 😉

 

Hope it helps !

CLAMaxime -- Kudos are a great way to say thank you
Message 2 of 5
(3,142 Views)
Solution
Accepted by converser26

Hi,

 

Or maybe something like this:array.pngarray - vi snippet.png

Download All
0 Kudos
Message 3 of 5
(3,134 Views)
Solution
Accepted by converser26

Check it will be esay.......to extractUntitled.png

0 Kudos
Message 4 of 5
(3,099 Views)

Thank you.

 

I am going to take all of your comments into my program.

0 Kudos
Message 5 of 5
(3,027 Views)