Write a MATLAB function with the following specifications: Input parameter 1: A
ID: 3794814 • 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: Sum of the input parameters Time interval: -2T lessthanorequalto t lessthanorequalto 2T Waveform 1 to plot: y(t) = A sin(B(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 codeExplanation / Answer
x=(t-C); %copy the value of t-C into x
y=(t-B); %copy the value of t-B into y
z=sum(A,B,C,D); %to evaluate sum of A,B,C,D
w=times(A,sin(B,x)); %times is a method used for multipling two values(A,sin(B,x))
v=times(A,cos(B,x)); %times is a method used for multipling two values(A,cos(B,x))
w1=sum(w,D); %to evaluate sum of w and D
w2=sum(v,D); %%to evaluate sum of v and D
fprintf('%i ',z); % fprintf is used to print content
fprintf('%i ',w1);
fprintf('%i 'w2);
grid_rectangular.w1; %grid_rectangular method is used to prinnt int rectangular format
grid_rectangular.w2;
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.