Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3. (40 Pts.) Write a script which takes the frequency, amplitude and type (sinusoidal, square or triangular) of a function as input from user and
3. (40 Pts.) Write a script which takes the frequency, amplitude and type (sinusoidal, square or triangular) of a function as input from user and plots the function y(t) at output. Hint: In MATLAB, you can generate a sinusoidal function by using "sin", a square function by using "square" and a triangular function by using "sawtooth" functions. User-inputs Select any frequency within the interval FE lkHz, 100 kHz , select the amplitude of the signal "VM" and define the time vector "t" in the interval tE 0 0F with an increment of 0.001/F and type of the signal such as 'sin', 'square' and 'triangular'. (5 pts.) Draw a flowchart and explain your problem solving strategy. (12 Pts.) Take values of frequency, amplitude, and type from the user. (4 Pts.) Define vector t. (10 Pts.) Use a switch-case condition for different types of desired output function (different cases.) Within each case, calculate the output vector y. You may use either a loop or vector operation in this stage. a. b. c. d. e. (9 Pts.) Plot your output vector y versus time vector t. Put labels, title and legend to your figure
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started