LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

compare data inside a table

A table contains some number of rows and some number of columns. I plan to get all the data in a column with GetTableCellRangeVals(). After getting them, i need to compare all the data to check if they are similar. Is there any CVI function available to compare these data instead of using for loop?
 
thanks
0 Kudos
Message 1 of 6
(3,531 Views)
What do you mean exactly with "similar"? With MaxMin1D you could obtain max & min values of data array so to have an index of how your data are close together, or you could obtain the standard deviation as an index of the dispersion of your data: depending on your requirements you may find into advanced analisys library some functions yo help you in your task.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 6
(3,523 Views)
Similar means same value. I will try the maxmin1D.
0 Kudos
Message 3 of 6
(3,501 Views)
Hi Popcorn,
 
What exactly are you trying to compare? Do you want to look to see if a column is the same as another column (or possibly a row)?
 
Are you just wanting to compare index x (where x is any number) in each column or row?
 
Or are you wanting to see how many times data shows up in the table (ie, compare all the values to one)?
 
I am thinking that the best way will be to use a for loop, we have a lot of great extra functionality in CVI but this sounds like a case where we might want to stick to the basics.
 
Let me know so I can further assist you.
With warm regards,

David D.
0 Kudos
Message 4 of 6
(3,498 Views)
im trying to check one table column to see if all of them are of the same group. If they all are the same then i will analyze all the rows in the table as one group. Else, i will need to analyze them as different group. After i determine which group they are in, i will check another table column to get the max value for all rows with the same group. I check the maxmin1D, it will only give the index of max value of first occurance if there's more than one max. Is there anyway, i can get all the indexes of all max values?
0 Kudos
Message 5 of 6
(3,496 Views)

MaxMin1D returns only one maximum and one minimum in your set of data and there is no possibility to detect the others with this functions.

Since your data are already stored in a table you could exploit table sorting facility to accomplish your task: sort the table based on one column and read the first and last lines to detect all the maximums and all the minimums. Since sorting the table you loose original order of your data, you may need to create an additional column that ramps up from 1 to number-of-rows so that the index of interesting cells can be detected and you can resort the table in original order after you have finished handling your data. This process can be repeated on the other columns.

I suggest that you make another control the active one and hide the table while doing this, as this may speed up the process a lot. Alternatively you could duplicate the table and work on the duplicated (hidden) one thus leaving original control untouched.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 6
(3,473 Views)