06-30-2012 08:54 AM
06-30-2012 11:59 AM
I am not sure what you mean by "trend". Are you looking for repeat patterns. (pattern + # of repeats)
Do you simply want to know how many unique elements there are?
How general is the array? Are the subset always increasing?
What should happen if there is no pattern?
In your example, what kind of output would you expect? (array, string of words, etc.)
06-30-2012 12:16 PM - edited 06-30-2012 12:18 PM
06-30-2012 12:21 PM - edited 06-30-2012 12:21 PM
Well, you could do a FFT and look for the fundamental frequency. 😄
If the repeats are really identical (i.e. DBL comparison precautions don't apply). Index the first elements (index 0), then seach for the first ocurrence of the same value starting at the second element (index 1) using search array. With some very simple math you should be able to get the period from the search result. Try it. 😄
06-30-2012 12:36 PM
06-30-2012 12:51 PM
the proof is in the "running it". Did you try? 😄
06-30-2012 12:51 PM
06-30-2012 12:53 PM
I tried but if I have have a 1d array with 1 element it dowen't works, any advice?
06-30-2012 12:55 PM
Of course it works, it will tell you that there are no more elements, which seems to be useful information. 😄
What kind of repeat do you expect with an empty array or an array with 1 element???
06-30-2012 01:02 PM
If I need it to return the number of elements too and there is no pattern how should I do that?