Question

In: Electrical Engineering

Write a MATLAB code to obtain the following. Keep your code commented whenever required. Copy your...

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.

  • x1= (A1+A2).cos(2πf1t)
  • x2= A2.cos(2πf2t)
  • x3= A3 times of a random vector of a similar length as that of vector ‘t
  • x4= Element by element division between x1 and x2
  • Open Figure#8, split this figure as shown below and draw:

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)

  • Use axis function to properly display each plot. Also add, x-axis label, y-axis label, Title and Legend to these plots.
  • Write an appropriate MATLAB code to call and test this function.

Solutions

Expert Solution

Here I took 80 spaces between 0 to 8 instead of 8000 for the clear view of plots.


Related Solutions

Write a MATLAB code to obtain the following. Keep your code commented whenever required. Copy your...
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. Develop three functions for temperature-conversion. Create a function called F_to_K that converts and return temperatures in Fahrenheit to Kelvin and store results in ‘F_to_K2.txt’. Create a function called C_to_R that converts and return temperatures in Celsius to Rankine and store results in ‘C_to_R2.txt’. Create a function called C_to_F that...
Write a MATLAB code to obtain the following. Keep your code commented whenever required. Copy your...
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. Generate the following vectors and also implement the Table-1 operations-map by employing the switch statement and an appropriate loop. Generate a vector ‘DEC1’ as follow. DEC1 = 5     1     3     0     2    5     0     2 Concatenate vector ‘DEC1’ eight times in order to obtain a bigger row vector ‘DEC’...
Write a MATLAB code to obtain the following. Keep your code commented whenever required. Copy your...
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. Develop three functions for temperature-conversion. Create a function called F_to_K that converts and return temperatures in Fahrenheit to Kelvin and store results in ‘F_to_K2.txt’. Create a function called C_to_R that converts and return temperatures in Celsius to Rankine and store results in ‘C_to_R2.txt’. Create a function called C_to_F that...
this is my matlab code for class, my professor commented "why is the eps an input...
this is my matlab code for class, my professor commented "why is the eps an input when it is set inside the function and not specified as a variable? how do i fix? function[] = () %Declare Global Variables global KS; global KC; KC = 0; KS = 0; End = 0; while (End == 0) choice = questdlg('Choose a function', ... 'Fuction Menu', ... 'A','B','B'); switch choice; case 'A' Program = 'Start'; while strcmp(Program,'Start'); Choice = menu('Enter the Trigonometric...
Use Matlab to write the following 1. Write code to determine whether a year is a...
Use Matlab to write the following 1. Write code to determine whether a year is a leap year. Use the mod function. The rules for determining leap years in the Gregorian calendar are as follows: All years evenly divisible by 400 are leap years. Years evenly divisible by 100, but not by 400, are not leap years. Years divisible by 4, but not by 100, are leap years. All other years are not leap years. For example, the years 1800,...
Write a matlab code to do following steps; i) Record your voice by sampling frequency 22...
Write a matlab code to do following steps; i) Record your voice by sampling frequency 22 kHz ii) Down sample the voice by 2 listen to your voice iii) Down sample the voice by 3 listen to your voice Please explain the code clearly. Thank you.
write the code in MATLAB with comments and show the inputs and results of the code...
write the code in MATLAB with comments and show the inputs and results of the code for the question below. Write an .m file in MATLAB, that records audio (you can record your own voice for 20 seconds that was recorded using your phone), then take Fourier transform of the signal (probably FFT).
QUESTION You are required to obtain a copy of a financial report for STRATEGIC ENERGY RESOURCES...
QUESTION You are required to obtain a copy of a financial report for STRATEGIC ENERGY RESOURCES LIMITED for the year ended 30 June 2019. The best way to locate their financial report is to go to their website and download a copy. This will normally be found under “Investor Information”, “Shareholder Information” or similar tabs on a company’s website. REQUIRED 1)  Identify and explain three key or significant audit matters that were raised in the audit report that may lead to...
show the MATLAB Code with comments and Write an .m file in MATLAB, that records audio...
show the MATLAB Code with comments and Write an .m file in MATLAB, that records audio (you can record your own voice for 20 seconds), takes Fourier transform of the signal (probably FFT).
write a matlab code to simulate fiber optics communication system on matlab simulink
write a matlab code to simulate fiber optics communication system on matlab simulink
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT