LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array pattern trend

Pattern.png

0 Kudos
Message 1 of 21
(4,274 Views)

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.)

0 Kudos
Message 2 of 21
(4,263 Views)

Untitled111.png

0 Kudos
Message 3 of 21
(4,259 Views)

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. 😄

0 Kudos
Message 4 of 21
(4,255 Views)

Untitled112.png

0 Kudos
Message 5 of 21
(4,251 Views)

the proof is in the "running it". Did you try? 😄

0 Kudos
Message 6 of 21
(4,243 Views)
Hint: autocorrelation
0 Kudos
Message 7 of 21
(4,242 Views)

I tried but if I have have a 1d array with 1 element it dowen't works, any advice?

0 Kudos
Message 8 of 21
(4,239 Views)

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???

0 Kudos
Message 9 of 21
(4,237 Views)

If I need it to return the number of elements too and there is no pattern how should I do that?

0 Kudos
Message 10 of 21
(4,234 Views)