From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to go from 3D Array to 2D Array

How does one go from 3D array to 2D array?
 
Examples?
0 Kudos
Message 1 of 15
(11,493 Views)
Do you want a 2D subset of the 3D array? If so, use the Array Subset function.

If you want to change the shape of the array while retaining all the data, use the Reshape Array function?

If you want somethnig else, please provide more details (like a small example).

Lynn
0 Kudos
Message 2 of 15
(11,471 Views)
Depends on what you're trying to do. If you just want one of the pages, use Index Array and wire just to the first index to select which "page" of the 3D array you want. The output will be a 2D array. Or, you can use the Reshape Array function. Wire the 3D array to it, and expand it to add another dimension so you can specify the number of rows and columns, and you'll get a 2D array. Check the documentation for more detail.

<After post edit> Sorry for the duplicate answer. Previous reply was posted right before I clicked the "Submit Post".

Message Edited by smercurio_fc on 03-06-2006 11:29 AM

0 Kudos
Message 3 of 15
(11,471 Views)

Thanks for replying.

I have attached what I have done so far.

0 Kudos
Message 4 of 15
(11,465 Views)
You are trying to insert a 3D array into a 2D array. The Help for the Insert into Array specifies that the dimension of the inserted element or subarray must have the same number of dimensions as the main array or fewer.

Please explain exactly what you are trying to do.

Lynn
0 Kudos
Message 5 of 15
(11,460 Views)

How would I do a 2D subset of the 3D array example I have for you.

 

Thanks.

0 Kudos
Message 6 of 15
(11,456 Views)
Your post did not include the 3D array VI so I substituted 3 nested for loops to generate a test array. The attached shows some of the ways to manipulate arrays. Read the help files and experiment a bit to get what you want.

Lynn
0 Kudos
Message 7 of 15
(11,444 Views)
I figured it out. It was so simple. Sorry for the silly question.
0 Kudos
Message 8 of 15
(11,444 Views)
If you don't understand something, please ask. The silly question is the one no one bothered to ask.

Lynn
Message 9 of 15
(11,433 Views)

Okay. Thanks for the encouragement. 

Is there a way to sort information in ascending/descending order using the subvi in my example below.

Attached subvi.

0 Kudos
Message 10 of 15
(11,432 Views)