positive square wave

Timo Budarz shared this problem 4 years ago
New

Why won't this function create a positive square wave: e(t)=mod(round(t),2)? The function e(t)=round(t) works fine. Why won't it take the modulus and plot it?

I know I can make a unit sized positive square wave using the f(x)=(sign(sin(w*x))+1)/2, but it just seems odd that the above method won't plot.

Timo

Comments (1)

photo
1

Hi, https://wiki.geogebra.org/e...

tell you that


  • mod(x) can't be used like an usual function (with a variable x)
  • you can use :


  1. e(x)=2(round(x)/2-floor(round(x)/2))

© 2021 International GeoGebra Institute