Matlab

BIT-WISE OPERATOR And SHORT CIRCUIT OPERATOR

BIT-WISE OPERATOR:

In bit-wise operator logical bit-wise operation is performed for positive integer input, where the input may be scalar or array. Below shows some functions of bit-wise operator.

Bitand       it performs the bit-wiseAnd operation on two positive integers.

For example: A = 28;         % binary 11100
                  B = 21;         % binary 10101

bitand (A, B) = 20
(binary 10100)

Bitor          it performs the bit-wiseor operation on two positive integers.

For example: A = 28;         % binary 11100
                  B = 21;         % binary 10101

bitor(A,B) = 29
(binary 11101)

Bitcmp   It returns the bit-wise complement as an n-bit number, where n is the second input argument to bitcmp.

    For example: A = 28;         % binary 11100
                  B = 21;         % binary 10101

bitcmp(A,5) = 3
(binary 00011)

Bitxor      It returns the bit-wise exclusive OR of two nonnegative integer arguments.

                                  For example: A = 28;         % binary 11100
                                                        B = 21;         % binary 10101

Bitxor (A,B) = 9
(binary 01001)

SHORT CIRCUIT OPERATOR:

 Short-circuit operator used when first operand does not determine the output fully we consider the short-circuiting operator to calculate the second operand.

&& It returns logical 1 (true) if both inputs calculate to true, and logical 0 (false) if they do not.


|| It returns logical 1 (true) if either input, or both, calculate to true, and logical 0 (false) if they do not.

RELATIONAL OPERATOR:

Relational operator performs element by element comparison between two arrays. They return a logical array of the identical size.

A < B                  A Less than B
A > B                  A Greater than B

A <= B                 A Less than or equal to B

C >= D                C Greater than or equal to D
A == B                 A Equal to B
A ~= B                 A Not equal to B
Rajeshwari Chiluveru

Rajeshwari (M.Tech) is the Technical Education Director at WebVidyalayam. She focuses on translating high-level systems engineering into accessible technology courses.

Share
Published by
Rajeshwari Chiluveru

Recent Posts

Samsung TV Red Light Blinking? 4 Fixes (2026 Power Logic Hub)

User Problem Scenario: The Red Light "Panic" You press the power button on your Samsung…

2 weeks ago

Samsung TV Not Connecting to WiFi: 2026 Easy Fix Guide

Introduction: I Know the Feeling "We’ve all been there. You sit down to watch your…

2 weeks ago

Samsung TV Restarting During Diagnosis? Fix the Reboot Loop Fast

User Problem Scenario: The "Diagnosis Loop" Paradox Imagine you notice your apps are slow. You…

2 weeks ago

Samsung TV Optimize Now Not Working? (2026 Fix: Greyed Out, Stuck or Not Responding)

🎓 Technical Module: Memory Maintenance Logic Module: WV-OS-307 Verified 2026 👨‍🏫 Instructor: Vangari Divya (M.Tech)…

2 weeks ago

Samsung Smart Hub Test Failed? (2026 Fix: DNS, ISP Block & Authentication Error)

 Introduction: The Setup Paradox "There is a specific moment of frustration for every Samsung Smart…

3 weeks ago

Samsung TV Picture Test Not Working? 4 Technical Recovery Fixes

Introduction: Lab Diary & Experience "When your Samsung TV screen begins to flicker or show…

3 weeks ago