LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sequence Generation

Solved!
Go to solution

Hi,

Can anyone help me how to generate the sequence as below. Output is array of 3 elements and input is number of iteration.

 

No of Iteration Index 0 Index 1 Index 2
5 0 0 5
10 0 5 10
15 5 10 15
20 5 10 20
25 5 15 25
30 10 20 30
n x y z

 

Thanks

0 Kudos
Message 1 of 8
(3,066 Views)

Hi vargeeshj,

 

search the "number of iteration" in the first column of your 2D array, when found you output the corresponding "index" values of the found row…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(3,063 Views)

Hi GerdW,

 

Thanks for the reply. As mentioned already number of iteration is the input for the program and the output is array of 3 elements

0 Kudos
Message 3 of 8
(3,061 Views)

Do you have an algorithm that describes this, or are you just trying to get us to do your homework for you?

0 Kudos
Message 4 of 8
(3,058 Views)

If i have an algorithm, I could have made it myself.

0 Kudos
Message 5 of 8
(3,056 Views)
Solution
Accepted by topic author vargeeshj

looks like your algorithm is index1=(iterations / 15) *5, index2=(iterations / 7)*5, index3=iterations.

 

I'm guessing this is not just purely a mathematical exercise though.

You can achieve the modulus operations using the Remainder and Quotient function.

 

EDIT: I initiallly wrote out as modulus operations but you really want integer quotient.

Message 6 of 8
(3,045 Views)

Your example is insufficient to identify a pattern. For example:

 

  • What should the output be if the input is not a multiple of five?
  • What if the input is zero or negative?
  • Is there an upper limit for N?
  • The third element (Index 2) is trivial and just seem to repeat the input, but what about the first and second output element?
  • "Index" is a somewhat reserved word with a special meaning. Why not use a different term?
  • Can you give us some background information on where this should be used? What's the purpose?
0 Kudos
Message 7 of 8
(3,040 Views)

@altenbach wrote:

Your example is insufficient to identify a pattern. For example:

 

  • What should the output be if the input is not a multiple of five?

The input is always multiple of 5 only.

  • What if the input is zero or negative?

Hence the type is unsigned, negative is taken care and zero is also not a valid input.

 

  • Is there an upper limit for N?

No. But is is multiple of 5.

  • The third element (Index 2) is trivial and just seem to repeat the input, but what about the first and second output element?

Thats the pattern what am looking for.

  • "Index" is a somewhat reserved word with a special meaning. Why not use a different term.
  • Can you give us some background information on where this should be used? What's the purpose?

Thanks

0 Kudos
Message 8 of 8
(3,030 Views)