2

I want to create an array mask which uses some logic bool to preserve array value like the python demo.

a=np.array([5,10,7,-8,6,-9,8])
b=np.array([1,-3,20,5,7,20,5])
mask= ((a<=10) & (0<=a)) & ((b<=10) & (0<=b))
Pa=a[mask]
Pb=b[mask]

the result is

Pa=[5 6 8]
Pb=[1 7 5] 

And I have use LabVIEW create the mask bool array how can I get the same result without for loop, because my problem array is so large that couldn't real time run. thanks. below images are LabVIEW code

enter image description here

enter image description here

1 Answer 1

1

The comparison operators ( = and in range?) can work on arrays. The resulting boolean array will have the same size as the largest of original arrays.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.