LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

initializing arrays

I need to initialize an array with 64 values. Is there an easy way to do it? It seems quite tedious to select each location and type in a value. The values will not be changeable at run time. Perhaps I am just going about it the wrong way.

 

Thanks

0 Kudos
Message 1 of 10
(3,253 Views)

Are all values the same?

 

The "Initialize array" function would be a logical place to start. Have you tried?

 

 

If the values are not the same, you must have some formula to derive it based on index. In this case, simply use an autoindexing FOR loop.

0 Kudos
Message 2 of 10
(3,251 Views)

Is there a pattern to the values you are putting in?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 10
(3,247 Views)

Oops, sorry. Forgot to mention that the numbers are quite random.

0 Kudos
Message 4 of 10
(3,243 Views)

@Good_Tweetie_Bird wrote:

Oops, sorry. Forgot to mention that the numbers are quite random.


I don't understand the term "quite random"....

 

Well, you want them to be random or do you want them to be defined based on some complicated formula?

0 Kudos
Message 5 of 10
(3,241 Views)

The values appear quite random, meaning that they have no formulaic sequence, but they are not random.

0 Kudos
Message 6 of 10
(3,232 Views)

@Good_Tweetie_Bird wrote:

The values appear quite random, meaning that they have no formulaic sequence, but they are not random.



unless you have an algorithm to generate them, you are stuck entering them manually. How is the program supposed to know what to enter?

0 Kudos
Message 7 of 10
(3,223 Views)

Try using FOR loop with auto-indexing enabled, as shown in the image attached.

0 Kudos
Message 8 of 10
(3,184 Views)

Try using FOR loop with auto-indexing enabled, as shown in the image attached.

Download All
0 Kudos
Message 9 of 10
(3,184 Views)

If you find it easier to enter the numbers into a spreadsheet, Read From Spreadsheet File.vi outputs a 1D and/or 2D array.

Message 10 of 10
(3,152 Views)