# Hobbyist Toolkit

cancel
Showing results for
Did you mean:

## Is there a way convert Boolean 2d array to 1d boolean array

Hello, presently doing one project I need help(How to convert Boolean 2d array to 1d boolean array?

Message 1 of 6
(811 Views)

## Re: Is there a way convert Boolean 2d array to 1d boolean array

As this is a basic LabVIEW question I would post it in the LabVIEW forum as you will get a quicker response.

Though, here is what I believe you are looking for.  This will also work with a 3D to 1D array also just by changing the input array size.

David Wilt
The New Standard LLC
Message 2 of 6
(786 Views)

## Re: Is there a way convert Boolean 2d array to 1d boolean array

@DavidWilt wrote:

Though, here is what I believe you are looking for.  This will also work with a 3D to 1D array also just by changing the input array size.

Slight edit here.  You don't actually need the FOR loop.  You can just use Multiply Array Elements (in the Numeric palette) instead.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 6
(782 Views)

## Re: Is there a way convert Boolean 2d array to 1d boolean array

@crossrulz wrote:

Slight edit here.  You don't actually need the FOR loop.  You can just use Multiply Array Elements (in the Numeric palette) instead.

Thanks, I did a quick look for that function and did not see one so used the For Loop.  Learn something new every day.

David Wilt
The New Standard LLC
Message 4 of 6
(778 Views)

## Re: Is there a way convert Boolean 2d array to 1d boolean array

A "boolean array" is green, not orange, so you need to read between the lines....

Still the shown solution should work for all datatypes. 😉

You could even make it into a malleable VI (*.vim) so it works for inputs of any number of dimensions and datatypes (within reason!), always resulting in a 1D array.

Another option would be to use a FOR loop and concatenating tunnel. (Same result, but 2D to 1D only).

Message 5 of 6
(754 Views)

## Re: Is there a way convert Boolean 2d array to 1d boolean array

I completed missed that it was a boolean array.  I used a double.  Wow I guess it was too early this morning and I should never try to answer questions before my coffee.

David Wilt
The New Standard LLC
Message 6 of 6
(750 Views)