MATLAB Answers

Need help in changing function from python to matlab

1 view (last 30 days)
Lisa Masipa
Lisa Masipa on 23 Oct 2020
Answered: Cris LaPierre on 23 Oct 2020
Need help in converting this code from python to MATLAB
def square_wave(period, amp):
def ret(i):
if i % period < period / 2:
return amp
return -amp
return ret


Sign in to comment.


Community Treasure Hunt

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

Start Hunting!