In: Electrical Engineering
Write a MATLAB code to obtain the following. Keep your code commented whenever required. Copy your source code and command widow outcomes and screen shots of any plots in your solution.
Write a user defined function ‘My_FunctionGen’. It accepts, the time vector ‘t’ with 8000 uniformly spaced values within the range of 0 to 8, Frequecy scalars ‘f1<100H’ and ‘f2<80Hz’ and Amplitude scalars ‘A1’, ‘A2’ and ‘A3’ as input arguments. It delivers x1, x2 and x3 and x4 as outputs and also generates plots, as shown in the following table. Where, x1, x2, x3 and x4 are defined as.
Plot vector ‘x1’ against vector ‘t’ in blue color. (Row 1, Column 1) |
Plot vector ‘x2’ against vector ‘t’ in red color. (Row 1, Column 2) |
Plot vector ‘x3’ against vector ‘t’ in cyan color. (Row 2, Column 1) |
Plot vector ‘x4’ against vector ‘t’ in green color. (Row 2, Column 2) |
[Superposition of data plots] Plot vector ‘x4’ against vector ‘t’ in magenta color. Plot vector ‘x3’ against vector ‘t’ in black color. Plot vector ‘x2’ against vector ‘t’ in blue color. (Row 3, Column 2) |