# An easy way to plot a sine wave in Matlab

It is one of the easiest ways to plot a sine wave in Matlab. As everyone knows that it is plotted on python which is a user-friendly language. You have to be more friendly with Python than another language to gain more knowledge about sine wave.
Yes, we can do sine wave using other language but for Matlab, you have to use Python. Python is mostly popular for machine level language as well as for Artificial Language. But we consider it as a cross-platform language. It can be used for games, AI, machine-level language, web etc.
The sine wave is normally like an analog wave where you will see a wave on a graph denoted highest as 1 and lowest as 0.

[smartslider3 slider=80]
As you can see that, there is all total of seven buttons and one graph table. And the buttons are like a left arrow, right arrow, home button, magnifier, save button, settings and pan axes. The home button is for resetting the original view. And the left and right arrow are to move the sine wave. pan axes with left, right and zoom. And zoom button is for magnifying the result.
Also, a setting is for configuring the subplots and save is for saving the figure.
##### Things you need to know before you plot a sine wave:
1. You need to install python or python 3.
2. You need to install python libraries that are numpy and matplotlib.
3. And you have to install pip or pip3.
4. And you can install the library by sudo pip or pip3 install and the library name.
Like you can see codes for the sine wave in Matlab below:
```import numpy as np
import matplotlib.pyplot as plt
a = np.arange(0,3*np.pi,0.1)
b = np.sin(x)
plt.title("sine wave form")
plt.plot(a,b)
plt.show()```
```import numpy as np
from matplotlib import pyplot as plt
a = np.arange(1,11)
b = 2 * a + 5
plt.title("Matplotlib ")
plt.xlabel("x axis caption")
plt.ylabel("y axis caption")
plt.plot(a,b)
plt.show()```
```import numpy as np
from matplotlib import pyplot as plt
a = np.arange(2,12)
b = 3 * a + 6
plt.title("Matplotlib demo")
plt.xlabel("x axis caption")
plt.ylabel("y axis caption")
plt.plot(a,b,"ob")
plt.show()```
```import numpy as np
import matplotlib.pyplot as plt
a = np.arange(0, 3 * np.pi, 0.1)
b = np.sin(x)
plt.title("sine wave form")
plt.plot(a, b)
plt.show()```
```from matplotlib import pyplot as plt
a = [5,8,10]
b = [12,16,6]
a2 = [6,9,11]
b2 = [6,15,7]
plt.bar(a, b, align = 'center')
plt.bar(a2, b2, color = 'g', align = 'center')
plt.title('Bar graph')
plt.ylabel('x axis')
plt.xlabel('y axis')
plt.show()```