Question
MUST BE IN MATLAB FORMAT ANSWER B ONLY NOT A (I ONLY PUT IN A FOR HELP) 1A) generate_square_wave Write a function called generate_square_wave that
MUST BE IN MATLAB FORMAT ANSWER B ONLY NOT A (I ONLY PUT IN A FOR HELP)
1A) generate_square_wave
Write a function called generate_square_wave that generates a square wave. The desired amplitude, number of periods, and number of samples per period (a.k.a. # of data points in each period) are passed into the function. The function returns a row vector containing the y values of a square wave. For example, if the following code was executed:
y = generate_square_wave(3, 10, 100); t = 0:length(y)-1; plot(t,y, '.-');
B) generate_triangle_wave
Write generate_triangle_wave(), which has the same input and output parameters as generate_square_wave(). If the above code instead called generate_triangle_wave()
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