# Matlab Project Help Tips: How to Add and Subtract Matrices In Matlab MATLAB is a very powerful program that can perform almost everything. From high-end programming to basic mathematical operations. However, using this sophisticated software cannot be mastered in a day. If you are a beginner, you will definitely need to familiarize yourself with the basics before venturing on complex projects. According to our MATLAB project help experts, adding and subtracting matrices is one of the hurdles faced by a number of students. Here is a guide on how to:

Defining a Matrix

• Launch MATLAB

When you start the MATLAB engine, you may get a “Student License”. Do not fret, this is not an error and shouldn’t hinder the functionality of the software.

• In the command window, type a word, letter or simple identifier for your new matrix

Please remember that identifiers are case sensitive and should not contain spaces. As a result, “A” is not the same as “a”. In this guide, we will define our matrix as “A”.

• Type an equal sign (“=”) followed by a left bracket (“[“).

The spacing between characters is acceptable. Therefore, typing “A=[ is similar to A = [.

Your values can be numbers or predefined variables. In this example, we will stick to just using whole numbers. Spaces are used to separate columns in a matrix. You can do this by pressing the space bar after entering a variable or number. Use semicolons to separate rows, then close the matrix with a right bracket “]”.

• To officially define your matrix, click on “Enter”

Clicking the enter button will make the matrix you have just defined to be visible on the command window and the workspace window.

• Make a review of your work

Proceed to perform functions with the matrix if you are content with the way it is defined. You can easily redefine your matrix if it does not appear as desired.

• Use the aforementioned steps to define your desired matrices

To help you understand, we will use two matrices which have “A” and “B” as identifiers.

• For matrices to be added or subtracted, they must be of the same length and width

If you do not consider this rule, you will get an error message

• If you want to do an addition, type the first identifier followed by a “+” or a “-“ sign if you want to do subtraction

After that, type the second identifier to be added or subtracted. Use this process for all the matrices, separating the identifiers by a plus or minus sign.

• Press Enter

Pressing enter performs the operation.