05-12-2014 04:23 AM
Hi
I am generating a stream of six numbers where three of them are spaced out quite evenly whereas the other three will be clustered quite close to one another. Can anyone suggest a method that will find the average value (or centroid) of the cluster of three? I have downloaded a clustering VI but I'm not quite getting the results I am after and the documentation isn't very good.
Many thanks
Jack
Solved! Go to Solution.
05-12-2014 04:53 AM
Hi Jack,
this could be a solution:
I don't claim to offer the most optimized solution, but it seems to work for me.
The main point is: you need to learn to develop an algorithm to tackle your problem. See the comments given as explanation in the snippet!
05-12-2014 05:03 AM
Hi jnaumann,
Since you are generating stream of six numbers where 3 numbers are evenly spaced i.e. consider them as an aray and the remaining threee numbers as cluster of 3 numbers.So on a whole your generation of pattern should be an array of clusters where each cluster element contains an array of 3 numbers and cluster of three numbers.So now use a for loop to index each cluster and use unbundle functions to seperate array and cluster and use the Mean function to calculate the mean of those three numbers in the cluster.
Regards,
SrikrishnaNF
05-12-2014 05:12 AM
05-12-2014 05:24 AM
Thats great - exactly what I was looking for. Just on query - when I have tried implementing this myself I have found I get a 2D array on the output from building my array as shown here. Do you know why that is happening? Cheers
05-12-2014 05:34 AM