Write a Matlab program to plot the cosine wave. That is plot y=cos(k1x) vs. x for x varying from 0 to 2pi radians. The value of k1 is given at the end of this document. You can choose the increment for x. Note that large values of the increment will give you a coarse graph. Note: Matlab has two functions to calculate the sine of an angle: sin(x) and sind(x). What is the difference between these two functions? Use help or doc command to find the answer.
Matlab code to plot cosine wave:
plot y Vs x
y = cos(k1*x)
legend( 'cosine(k1*x) Vs x', 'location','Northwest')
The above code is given based on the information provided in the question
The difference between the functions sin(x) and sind(x):
Both are used to find the argument of the sine function for the given values but sin(x) is used when the arguments are in "RADIANS", whereas sind(x) is used when the arguments are given in DEGREES".
Get Answers For Free
Most questions answered within 1 hours.