04-13-2012 12:07 PM
Hi
I have created a 3D array using the initialise array node, however I have two questions.
1) How can I access only the third value of the array?
2) How can I make the value of the dimension ‘x’ as it is an unknown value?
attached is an image of my array.
Many thanks
Solved! Go to Solution.
04-13-2012 12:55 PM
Here is an attempt to solve the first question
please see the attached file.
04-13-2012 12:59 PM
Can you explain what you want for the second question?
04-13-2012 01:57 PM
@sbash123 wrote:
Hi
I have created a 3D array using the initialise array node, however I have two questions.
1) How can I access only the third value of the array?
Third value from where? This doesn't make a lot of sense. Do you want the value of index (0,0,2), (0,2,0), or (2,0,0)? Any of these could be considered the 3rd value.
2) How can I make the value of the dimension ‘x’ as it is an unknown value?
This also doesn' make much sense. You're initializing the array so you know how large you're making it in each dimension. If you want, you could wire controls into the dimensions.
attached is an image of my array.
Many thanks
04-15-2012 11:18 AM
How can I make the value of the dimension ‘x’ as it is an unknown value?
what i mean by the secind question is, i have and array with an unkown value for its dimension. how could i program that, the code will be as follows:
an array of zeros where:
h=zeros(length(x), length(y), length(t));
and for the first quesion i want to access all of the values in length x and y however only the first value of length t so it would be:
h(:,:,1)
many thanks
04-15-2012 11:19 AM
hi, sorry i cannot open the attachment as the version of labview is different could you please send it as an image?
Many Thanks 🙂
04-15-2012 11:45 AM
To get a plane (2Darray) from a 3D array, you use "index array" and only wire one of the indices (read the help!). Depending on which index you wire, you get an xy, xz, or yz plane. (Similarly, of you wire two indices, you would get a 1D array line of the 3D array. If you wire all three indices, you get a single element from that specified location.)
The "array size" will give you an array with three elements (in the case of a 3D array), each number represents the size of one of the dimensions.
04-15-2012 11:47 AM
thank you, so what if the size of the dimesion is unkown?
04-15-2012 11:53 AM - edited 04-15-2012 11:55 AM
"array size" gives you the dimension sizes, one value for each dimension.
The number of dimensions (1D, 2D, 3D, etc.) cannot change for the same wire. You could look at the array size of the array size output, which would be 3 in the case of a 3D array.
04-15-2012 12:40 PM
@altenbach wrote:
To get a plane (2Darray) from a 3D array, you use "index array" and only wire one of the indices (read the help!). Depending on which index you wire, you get an xy, xz, or yz plane. (Similarly, of you wire two indices, you would get a 1D array line of the 3D array. If you wire all three indices, you get a single element from that specified location.)
Here is a simple example.