LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to access only the third dimension within a 3d array?

Solved!
Go to solution

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

0 Kudos
Message 1 of 25
(3,040 Views)

Here is an attempt to solve the first question

please see the attached file.

0 Kudos
Message 2 of 25
(3,029 Views)

Can you explain what you want for the second question?

0 Kudos
Message 3 of 25
(3,026 Views)

@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


 

0 Kudos
Message 4 of 25
(2,886 Views)

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

0 Kudos
Message 5 of 25
(2,860 Views)

hi, sorry i cannot open the attachment as the version of labview is different could you please send it as an image?

 

Many Thanks 🙂

0 Kudos
Message 6 of 25
(2,859 Views)

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.

 

 

 

 

0 Kudos
Message 7 of 25
(2,855 Views)

thank you, so what if the size of the dimesion is unkown?

0 Kudos
Message 8 of 25
(2,852 Views)

"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.

 

0 Kudos
Message 9 of 25
(2,850 Views)

@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.

0 Kudos
Message 10 of 25
(2,841 Views)