I am doing a school assignment, would like to get a help with the below:

2 views (last 30 days)
We want to build in MatLab a realistic square generator function that will realize a square signal corresponding to a time vector t using a series of sine function with a given frequency f and with a given precision (order of the series) kmax. The mathematical formula of this object is: (see attached image)
  • The prototype of the function will be: function y=SquareGenerator(t,f,kmax)
  • If kmax is not defined a value of 20 will be used.
  • If f is not defined a value of 1 will be used
  • If t is not a vector (scalar or matrix) an error message will be displayed.

Accepted Answer

Rafael Hernandez-Walls
Rafael Hernandez-Walls on 28 Jul 2017
Edited: per isakson on 28 Jul 2017

More Answers (0)

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!