09-12-2013 11:51 AM
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
09-12-2013 11:52 AM - edited 09-12-2013 11:55 AM
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.
09-12-2013 11:54 AM
Is there a pattern to the values you are putting in?
09-12-2013 11:57 AM
Oops, sorry. Forgot to mention that the numbers are quite random.
09-12-2013 12:01 PM - edited 09-12-2013 12:02 PM
@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?
09-12-2013 12:17 PM
The values appear quite random, meaning that they have no formulaic sequence, but they are not random.
09-12-2013 12:35 PM
@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?
09-13-2013 11:30 AM
Try using FOR loop with auto-indexing enabled, as shown in the image attached.
09-13-2013 11:30 AM
Try using FOR loop with auto-indexing enabled, as shown in the image attached.
09-13-2013 02:55 PM
If you find it easier to enter the numbers into a spreadsheet, Read From Spreadsheet File.vi outputs a 1D and/or 2D array.