MATLAB stands for MATrix LABoratory.

It is a multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in another language.

To use MATLAB for Windows or MacOS follow this link. To know how to use MATLAB online you can see our other Blog How to use MATLAB online for Free.

So, at first, we will start with the essential trigonometric function. We will plot the Sin wave using MATLAB.

To write the script, open your MATLAB from your PC.

Then create a New Blank Script and from the EDITOR menu Save it into your preferred location on your Disk.

[Note that you have to save every time you make any changes to your program. Otherwise, the program will not reflect in your plot.]

Then paste the code written below-

t= [0 : .1 : 10]            [we can also write, t= 0 : .1 : 10]

x=sin(t)                     

plot(t,x)


Then save the code and hit the run button from the EDITOR menu of MATLAB.

Then the figure will be displayed in a new window.


The x-axis refers to the time and the y-axis belongs to the amplitude.

Similar to the previous one we can plot Cos.

t= 0 : .1 : 10;        

x=cos(t);                     

plot(t,x)

you can see the little changes in the code.