Question

In: Computer Science

write the MATLAB code for: Let ? = sin2 (?) and ? = sin(?) cos(?). Let...

write the MATLAB code for: Let ? = sin2 (?) and ? = sin(?) cos(?). Let x vary from 0 to 10? in increments of 0.1?. Plot two figures part a & b. This panel has rows, one figure per row. a. Plot x versus y. This plot is on the top of panel and the next figure (part b) is at bottom of panel. i. Give a meaningful title to this figure. ii. x-axis is time with unit of s. y-axis is voltage with unit of V. Label both x- and yaxis. iii. Add a legend to the graph. b. Plot x versus z. This figure is at bottom row. i. Give a meaningful title on graph. ii. Label x-axis is time with unit of s. y-axis is voltage with unit of V. Label both xand y- axis. iii. Change the thickness of this curve. Use any value other than default value. iv. Change curve to red dashed curve. v. Add a legend to the graph.

Solutions

Expert Solution

`Hey,

Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

clc
clear all
close all
format long
x=0:0.1*pi:10*pi;
y=sin(x).^2;
z=sin(x).*cos(x);
subplot(2,1,1)
plot(x,y);
title('Plot of x vs y');
xlabel('Time (s)');
ylabel('Voltage (V)');
subplot(2,1,2)
plot(x,z,'--r','LineWidth',3);
legend('Voltage');
title('Plot of x vs z');
xlabel('Time (s)');
ylabel('Voltage (V)');

Kindly revert for any queries

Thanks.


Related Solutions

Write a matlab code for given task Use your ‘sin’ or ‘cos’ function to generate a...
Write a matlab code for given task Use your ‘sin’ or ‘cos’ function to generate a sinusoid wave having two components as f1 = 3kHz and f2 = 5kHz and then sample it with fs = 10kHz. Calculate its fft with zero frequency component in the middle. Plot it on a properly scaled w-axis. Specify if there is aliasing or not? If there is aliasing specify which component is casing the aliasing
This code is to be written in Matlab. Write a function that will plot cos(x) for...
This code is to be written in Matlab. Write a function that will plot cos(x) for x values ranging from -pi to pi in steps of 0.1, using black *'s. It will do this three times across in one Figure Window, with varying line widths. If no arguments are passed to the function, the line widths will be 1, 2, and 3. If on the other hand, an argument is passed to the function, it is multiplier for these values....
Using Matlab, Write a script that validates the relationship between sin u, cos u, and tan...
Using Matlab, Write a script that validates the relationship between sin u, cos u, and tan u by evaluating these functions at suitably chosen values. Please screenshot Matlab screen. Thank you!
Write your own MATLAB code to solve the system 10 − x + sin(x + y)...
Write your own MATLAB code to solve the system 10 − x + sin(x + y) − 1 = 0 8y − cos2 (z − y) − 1 = 0 12z + sin(z) − 1 = 0 using a residual tolerance of 10^−6 and the initial guess, ~x 0 = [0.1, 0.25, 0.08]^T . Print out the values for x, y and z for each iteration in a table similar to the one you created for the problems of the...
verify the identities a.) (cos 8x + cos 4x) / (sin 8x - sin 4x) =...
verify the identities a.) (cos 8x + cos 4x) / (sin 8x - sin 4x) = Cot(2x) b.) tan^2(x/2) = 1 - 2cot(x)csc(x) + 2Cot^2x
The point ?(√6 cos ? , √3 sin ?) is on an ellipse. a) Write down...
The point ?(√6 cos ? , √3 sin ?) is on an ellipse. a) Write down the equation of this ellipse in Cartesian form and find its foci. b) A hyperbola has the same foci as this ellipse and one of the branches cuts the ?-axis at 1. What is the equation of the hyperbola?
proof Sin(A)-Sin(B), cos(A)+cos(B) Geometrically, A and B are acute angles
proof Sin(A)-Sin(B), cos(A)+cos(B) Geometrically, A and B are acute angles
a) Let ?(?) = cos(2??) and ?(?) = cos(20??). Write the mathematical expression for the Fourier...
a) Let ?(?) = cos(2??) and ?(?) = cos(20??). Write the mathematical expression for the Fourier transform of ?(?) = 4[1 + 0.5?(?)]?(?) as a function of both ? (rad/s) and ? (Hz) by hand. Moreover, plot the magnitude spectrum of ?(?) by hand as functions of both ? (rad/s) and ? (Hz). b) By using a 2x1 subplot, plot ?(?) signal in the first row. Take ? between -20 s and 20 s with an increment of 1 ms....
Using Matlab code, solve the following: (a) Consider first the undamped pendulum ? + sin ?...
Using Matlab code, solve the following: (a) Consider first the undamped pendulum ? + sin ? = 0, ?(0) = 0, ? (0) = b. Let x = ? and y = ? ; then x and y satisfy the system x = y y = ? sin x, x(0) = 0 y(0) = b. Solve this system numerically and plot, on a single graph, the resulting trajectories for the initial velocities b = 0.5, 1, 1.5, 2, 2.5. Use...
Express sin 6θ as a polynomial in sin θ and cos θ.
Express sin 6θ as a polynomial in sin θ and cos θ.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT