Matrix Laboratory (MATLAB)

Introduction (What is MATLAB):

Matrix Laboratory or MATLAB for short is perhaps the most popular tool used for computation and data visualization. The reason for its popularity are more to do with Microsoft monopoly on the software market because of its operating system than it being the best tool out there. But that would be me deviating from the topic.

So first of all what is Computation?

Any type of mathematical modelling especially involving the use of computers to process the data is computation. Now one would say is that not calculation? Well, no. Calculation is just the computation of numbers while computation as a whole involves information processing in general.

Matlab is basically a fourth generation programming language that allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages, including C, C++, Java, Fortran and Python.

Any tutorial on the net would start with its downloading and installation but well its already very well documented at their MATLAB official Documentation

So plunging ahead and coming directly to the point,


MATLAB has the capability of working on numerical data in the form of matrices and arrays.

Language fundamentals include basic operations, such as creating variables, array indexing, arithmetic, and data types.

It is a loosely typed language. Meaning there is no need to explicitly define a variable unless there is symbolic reference as an object.


A simple = is used to assign value to variables:

>> x = 17

x =


x = ‘hat’

x =


x = [3*4, pi/2]

x =

12.0000    1.5708

y = 3*sin(x)

y =

-1.6097    3.0000

Arrays and Matrices

A simple array is defined using the colon syntax:

init : increment : terminator

>> array = 1:2:9

array =

1 3 5 7 9

array starts at 1 (the init value), increments with each step from the value by 2 (the increment value), and previous  stops once it reaches (or to avoid exceeding) 9 (the terminator value)

Other features include Array indexing, concatenation, sorting, and reshaping.

Operators and Elementary Operations

  • Arithmetic: Addition, subtraction, multiplication, division, power, rounding
  • Relational: Operations Value comparisons
  • Logical Operations: True or false (Boolean) conditions
  • Set Operations: Unions, intersection, set membership
  • Bit-Wise Operations: Set, shift, or compare specific bit fields

Data Types

By default, MATLAB® stores all numeric variables as double-precision floating-point values. Additional data types store text, integer or single-precision values, or a combination of related data in a single variable. For more information, see Fundamental MATLAB Classes or watch Introducing MATLAB Fundamental Classes (Data Types).


As I said earlier this post is not a tutorial for Matlab one can easily find a well defined documentation. Some other basic features include:


Linear algebra, basic statistics, differentiation and integrals, Fourier transforms, and other mathematics


Two- and three-dimensional plots, images, animation, visualization

Programming Scripts and Functions

Program files, control flow, editing, debugging

Data Import and Export

Text files, spreadsheets, and other file formats; big data; web access

GUI Building

Application development using GUIDE and callbacks

Advanced Software Development

Object-oriented programming; code performance; unit testing; external interfaces to Java , C/C++, .NET and other languages

Desktop Environment

Preferences and settings, platform differences

Supported Hardware

Support for third-party hardware, such as webcam, Raspberry Pi™, and Arduino® hardware


As a teaching tool, though, it suffers from one major defect: it’s very expensive. And the add-on toolboxes add to its cost.

There’s therefore the need of a low-cost – preferably open-source – alternative, which can be used by students as a sort of drop-in replacement for experimentation at home, or on their own laptops.

My recommendations? Use Octave, unless you have some niche requirements, in which case you may find Scilab more suitable. If you’re prepared to sacrifice maturity for speed, give Julia a go. If your wish is a mature programming language as your base, then Python.


Saleem Ahmed

Coder, Algorithm Designer, Growth Hacker. Ubiquitous Problem Solver, #NodeJs #AngularJs #MeanStack Listening to Bach helps me concentrate on building things. Passion for anything related to technology, especially interested towards application of AI and machine learning to solve real world problems.


Leave a Reply