Matlab

MATRIX OPERATIONS

Deleting row or column in matrix:

An empty braces [] will define the entire row and column of a matrix is deleted. Let us consider an example deleting 2nd row of the:

 a = [3 4 5 6 7; 2 3 4 5 6; 1 2 3 4 5;  4 5 6 7 8];

a ( 2 , : ) = []

if we want to delete the 3rd  column of the given example

a = [2 3 4 5 6; 1 2 3 4 5; 3 4 5 6 7; 4 5 6 7 8];

a(: , 3)=[]

Matrix Operation:

Now let us discuss some commonly used matrix operations are:

Addition and subtraction of matrix:

While performing matrix addition and subtraction when both the operand of matrices must have same number of rows and columns.

Let us consider an example

a = [2 1 3; 4 5 6; 7 8 9];

b = [4 5 6; 1 2 3; 7 8 9];

c = a + b

a = [3 2 4; 4 5 6; 7 8 9];

b = [2 1 3; 3 2 1; 4 5 6];

d = a – b

If we run script file we get:

c= 6 6 9

     5 7 9

     14 16 18

d= 1 1 1

     1 3 5

      3 3 3

Division of (right, left) matrix:

If we want to perform the division of two matrices left (\) or right (/) division operation, when both the operand of matrices must have same number of rows and columns.

Now let us consider an example:

a = [1 2 3; 4 2 6; 7 5 2];

 b = [3 5 6; 2 3 8; 5 7 2];

 c = a / b

d = a \ b

If we run the above example we get output as:

c = -0.7916   0.1666   0.2083

      1.0833   4.3333   0.9166

       2.9583 4.6666   3.8333

 d =

-3.27778   -1.05556   -4.86111

 -0.11111   0.11111   -0.27778

 3.05556      1.27778   4.30556

Transpose of matrix:

The transpose operation will be defined as switching of the rows and columns in a matrix. And it will be represented as a single quote (‘).

Let us consider example:

a = [11 12 13; 14 8 6; 27 8 9]

b = a’

It displayed has:

a = 11 12 13

      14 8   6

      27 8   9

b = 11 14 27

       12 8   8 

       13 6   9

Rajeshwari Chiluveru

Rajeshwari is a Smart TV and connectivity specialist with over 7 years of hands-on experience in troubleshooting real-world device issues. She has worked extensively on diagnosing problems such as WiFi not working, HDMI ARC/eARC failures, app errors, and connectivity issues across platforms like Samsung, Hisense, and Android TV. At Web Vidyalayam, she focuses on creating verified, step-by-step solutions based on practical testing rather than theory. Her goal is to simplify complex technical problems and help users fix their devices quickly and confidently.

Share
Published by
Rajeshwari Chiluveru

Recent Posts

Hisense Smart TV WiFi Not Working? Easy Fixes That Work (2026 Guide)

Introduction: When your Hisense TV won't connect to WiFi, it is rarely a problem with…

1 month ago

Fix Hisense TV Storage Space Running Out: 2026 OS Logic Hub

Hisense Google TV Storage Space Running Out: Why it Happens and How to Fix It…

1 month ago

Samsung Smart TV HDMI ARC/eARC Not Working? Easy Fixes That Actually Work (2026 Guide)

Introduction: "Setting up a soundbar with your Samsung TV should be simple, but the HDMI…

1 month ago

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 months 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 months 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 months ago