LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

binary matrix multiplication

Solved!
Go to solution

Hi,

 

How do I multiply two binary matrices in labview? tried using boolean OR operator but it is not working

 

thanks

0 Kudos
Message 1 of 40
(4,982 Views)

Hi sumalama,

 

please attach a VI containing your two factors of that multiplication and the expected result!

 

LabVIEW doesn't know of an error message like "it's not working"...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 40
(4,971 Views)

Hi sumalama,

 

What do u mean by multiplication in this instance??

Please check this is what u need?

 

Thanks
uday
0 Kudos
Message 3 of 40
(4,964 Views)

Hi,

 

I have attached the screenshot of my VI, please have a look

 

thanks

binary.png

0 Kudos
Message 4 of 40
(4,956 Views)

Hi sumalama,

 

is there a reason to use matrix datatype instead of plain 2D arrays?

 

When you want to use boolean operations you're bound to use arrays. Convert the matrices into arrays (if possible boolean arrays) and use the functions of the boolean palette!

matrix.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 40
(4,950 Views)

Even with matrices it does function!

matrix.png

Though 2D arrays are recommended, so you can use boolean arrays

---

UnCertified LabVIEW Student
Mistakes are for learning, that's why suggestions are always welcome!
0 Kudos
Message 6 of 40
(4,946 Views)

Hi Koen,

 

I would be very careful to wire DBL values to a boolean function. Please try your snippet with different values than just 0 and 1...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 40
(4,941 Views)

Yes you are right, but he was talking about booleans.

But you are right DBL's aren't that great for comparison Smiley Happy

---

UnCertified LabVIEW Student
Mistakes are for learning, that's why suggestions are always welcome!
0 Kudos
Message 8 of 40
(4,936 Views)

Hi,

 

I had used the arrary first and it gives me unexpected result, dimension is not correct, attached is screenshot. I want to multiply the two matrices so i am using OR function.

 

 

binary2.png

 

thanks

0 Kudos
Message 9 of 40
(4,933 Views)

Hi sumalama,

 

now we getting to the core of the problem: You're mixing array operations with mathematical matrix calculations!

That's what I meant with "attach a VI with values and expected result"...

 

Please look in the mathematics->linear algebra functions palette and pick the correct functions to "multiply" two arrays. The correct wording should be "A×B" (cross/vector product)!

 

Btw. the boolean OR is usually the replacement for an addition, while the AND is considered the "boolean multiplication"...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 40
(4,921 Views)