10-19-2016 06:49 PM
I am using the mode function to calculate the mode value of an array and it returns NaN. LabVIEW help says it only returns NaN when array input is empty. I am not sure why this happen. My array is
0.00015
0.000114
0.000146
0.000188
0.000139
I did try with mulitple value of intervals.
Thanks in advance.
Solved! Go to Solution.
10-19-2016 07:04 PM
I think your number of intervals needs to be less than or equal to the input array size.
If you set it to a negative number then it should always return the most commonly occuring value instead of using bins.
10-20-2016 09:09 AM
Kyle97330,
I have just tried to use -1 but it is still does not work.
I am not sure NaN means it cannot find the repeat value or not.
10-20-2016 09:26 AM
NaN in this case means that no mode was found. Look at it this way... you have a group of numbers and are telling LabVIEW to break it up into 1000 separate "bins". If each bin has only 1 value in it, then there is no mode - no single value that appears more often than other values.
For your data set, any number of intervals < = 14 will return a mode. Any > 15 will return NaN.
10-20-2016 09:30 AM
10-20-2016 09:30 AM
Thanks Bowen,
Actually I have just found out the answer by using the historgram. It illustrated the reason very clear to me.
10-20-2016 01:20 PM
Thanks Gred, I got this now.