01-11-2021 04:50 AM
Hello, presently doing one project I need help(How to convert Boolean 2d array to 1d boolean array?
01-11-2021 06:39 AM
01-11-2021 06:47 AM
@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.
01-11-2021 06:51 AM
@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.
01-11-2021 03:38 PM - edited 01-11-2021 03:42 PM
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).
01-11-2021 03:41 PM