| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Have 2D array completed: 1 2 3 4 5 6 7 81 2 3 4 5 6 7 8Need to add dimension:1 1 2 3 4 5 6 7 81 1 2 3 4 5 6 7 82 1 2 3 4 5 6 7 8 etc |
|
#2
| |||
| |||
| Is that first column supposed to be the "page" for the 3D array? A Build Array is what you need to use. Example_VI.png: http://forums.ni.com/attachments/ni/...Example_VI.png |
|
#3
| |||
| |||
| Or if you are creating a constant you can right click on it and select add dimension. |
|
#4
| |||
| |||
| Thank you for the quick replies. One problem remains, I do not have a second 2D array for the build function.I simply have a dimension value, which varies of course. |
|
#5
| |||
| |||
| markfranklin wrote:One problem remains, I do not have a second 2D array for the build function.If you have a 1D array then make it into a 2D array using the same function. Please read the documentation on Build Array.I simply have a dimension value, which varies of course.I have no idea what this means. |
|
#6
| |||
| |||
| The third dimension (shown as 1 and 2 on far left of first example) is simply a card number that needs to be stored with the 2D array of data. I was hoping that this card number could be a third dimension to ease look-ups later. |
|
#7
| |||
| |||
| Are you actually wanting to create a 3 dimensional array? Or do you just want to add another row (or column) to a 2 dimensional array? |
|
#8
| |||
| |||
| I believe that a 3D array would serve me best. |
|
#9
| |||
| |||
| The thing you have to keep in mind with multi-dimensional arrays is that you can't have different number of elements for each row/column/page. This means that if you had a 2D array, you can't have, for example, row1 have 5 elements and row2 have 7 elements. Each row has to have the same number of columns. (The equivalent is true for columns). For a 3D array, each page has to have the same size 2D array. Thus, if you want to have the first page with a 2D array of 2 rows and 8 columns, and the second page be a 2D array of 1 row and 8 columns, you can't do that. The second page must be the same size - 2 rows and 8 columns. If this is not acceptable for your application, then you must change your data structure. In your initial post you provided a small snippet, which seemed to imply that you were adding pages, with each page being the same size. Is this true? |
|
#10
| |||
| |||
| Thank you. An instrument VI outputs a 2D array for each card in the instrument (card number can vary).Each time it outputs a 2D array, there is a card number associated with the data.I had thought that it would be best to add a dimension for including the card number.Perhaps that is a bad idea?I am beginning to think that building or appending the 2D array to more simply include the the card number. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.