Hitesh Sahu
Hitesh SahuHitesh Sahu
  1. Home
  2. ›
  3. posts
  4. ›
  5. …

  6. ›
  7. 2 Operators

Loading ⏳
Fetching content, this won’t take long…


💡 Did you know?

🐙 Octopuses have three hearts and blue blood.

🍪 This website uses cookies

No personal data is stored on our servers however third party tools Google Analytics cookies to measure traffic and improve your website experience. Learn more

Loading ⏳
Fetching content, this won’t take long…


💡 Did you know?

🍯 Honey never spoils — archaeologists found 3,000-year-old jars still edible.
Cover Image for MATLAB Operators

MATLAB Operators

Detailed overview of MATLAB operators including arithmetic, relational, logical, matrix, and element-wise operations with practical examples for numerical computing.

Hitesh Sahu
Written by Hitesh Sahu, a passionate developer and blogger.

Wed Feb 25 2026

Share This on

MatLab Operators

Operators📈 Overview

  • Arithmetic Operations
  • Relational Operations
  • Logical Operations
  • Set Operations
  • Bit-Wise Operations

Arithmetic Operators

+, -, *, /, ^, ()

Order of Operation

() > ^ > *, / > +-

Notes:

  • A*b multiply all elements of A with scalar b

A^n

A to the power n

A.^n

Multiply Each Element of Vector by nth power

A.*B

Multiply Consecutive elements of Matrix A & B

Matrix multiplication (A*B )

Given two Matrix A(mXn)A(mXn)A(mXn) & B(nXo)B(nXo)B(nXo) then A∗B=C(m∗o)A*B = C(m*o)A∗B=C(m∗o) matrix Where C(i,j)=A(i,k)∗B(k,j)C(i,j)= A(i,k)*B(k,j)C(i,j)=A(i,k)∗B(k,j)

Dot product/ Inner Product of Vector(A.B)

RowVector(1n) Column Vector(n1) = Scalar()11

Outer Product of Vector (A⊗B)

Column Vector(n1) RowVector(1n) = Matrix(nn)

RightDivide (./)

A./B : divide all elements of A with corresponding elements of B

A./b : divide all elements of A with vector b

Left Divide (.)

A.\B : divide all elements of B with corresponding elements of A

b.\B : divide all elements of B with vector b


Relational Operators

<, > , <=, >=, ==, ~=

  • A>B - return array of 1,0 by comparing each elements of A with B -A*b - return array of 1,0 by comparing each elements in A & b

Complex Numbers

  • >, <, >= <= compare only the real part
  • == , ~= test both real and imaginary parts.
Undefined values:
  • Inf == other Inf values. -NaN ~= numeric value, including other NaN values.
  • NaT ~= datetime value, including other NaT values.
  • Undefined ~= any other categorical value, including other undefined elements.

Logical Operators

  • Assert: true, false
  • Logic : |, &, ~, xor
  • Short Circuit: ||, &&,
  • Logical : islogical, logical
  • find, all, any
  x = v1(v1<4 & v1>2)
  x = all value of v1 between 2 & 4

  • L = logical(A) converts A into an array of logical values.
  • Any nonzero element of A is converted to logical 1 (true) and zeros are converted to logical 0 (false).
  • Complex values and NaNs cannot be converted to logical values and result in a conversion error.
MatLab/2-Operators
Let's work together
+49 176-2019-2523
hiteshkrsahu@gmail.com
WhatsApp
Skype
Munich 🥨, Germany 🇩🇪, EU
Playstore
Hitesh Sahu's apps on Google Play Store
Need Help?
Let's Connect
Navigation
  Home/About
  Skills
  Work/Projects
  Lab/Experiments
  Contribution
  Awards
  Art/Sketches
  Thoughts
  Contact
Links
  Sitemap
  Legal Notice
  Privacy Policy

Made with

NextJS logo

NextJS by

hitesh Sahu

| © 2026 All rights reserved.