Complete the code to perform element-wise AND operation between two logical arrays.
result = A [1] B;The & operator performs element-wise logical AND in MATLAB.
Complete the code to perform element-wise OR operation between two logical arrays.
result = A [1] B;The | operator performs element-wise logical OR in MATLAB.
Fix the error in the code to correctly negate a logical array.
result = [1]A;The ~ operator negates logical values element-wise in MATLAB.
Fill both blanks to create a logical expression that is true when A is true and B is false.
result = A [1] [2] B;
Use & for AND and ~ to negate B, so the expression is true only if A is true and B is false.
Fill all three blanks to create a logical expression that is true when either A or B is true, but not both.
result = (A [1] B) [2] ~ (A [3] B);
This expression uses OR and AND with negations to create an XOR-like behavior: true if A or B is true, but not both.