Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a MATLAB function with the following specifications: Input parameter 1: A

ID: 2079925 • Letter: W

Question

Write a MATLAB function with the following specifications: Input parameter 1: A Input parameter 2: B Input parameter 3: C Input parameter 4: D Output parameter: Stun of the input parameters Time interval: -2T lessthanorequalto t lessthanorequalto 2T Waveform 1 to plot: y(t) = - c)) + D Waveform 2 to plot: y(t) = A cos(B(t - c)) + D Display two plots in vertical fashion on one figure Include all labeling on both plots. Add a grid to both plots. Include Help comments Include comments in the body of the code

Explanation / Answer

MATLAB CODE

% Input parameters are added
A= input('input paramter 1 : A');
B= input('input paramter 2 : B');
C= input('input paramter 3 : C');
D= input('input paramter 1 : D');
%Summation of parameters
Sum = A+B+C+D;
disp(Sum);
%Time interval
t=-2:0.001:2;
%signal specified
y1=A*sin(B*(t-C))+D;
y2=A*cos(B*(t-C))+D;
%plot both the signal
subplot(2,1,1);
plot(t,y1);
xlabel('time');
ylabel('amplitude');
subplot(2,1,2);
plot(t,y2);
xlabel('time');
ylabel('amplitude');
hold off
%Grid added
grid on

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote