**SQUAREWAVE**

SQUAREWAVE(Time, Period, Value1, Value2) provides a square wave function.

Time is the value of time (sec or hours)

Period is the period of the square wave (sec or hours), i.e., the time required for one complete cycle including the both sections.

Value1 is the value returned by the function if (Time-(trunc(TIme/Period)*Period)<=Period/2

Value2 is the value returned by the function if (Time-(trunc(TIme/Period)*Period)>Period/2

Value1 and Value2 should have the same dimensions and units. The value returned by the function will have the same dimensions and units as Value1,

**Example:**

V1=0.9 [m]

V2=0.1 [m]

Period=0.25 [s]

Time=2.1 [s]

x=**squarewave**(Time,Period,V1,V2)

{x=0.9 [m]}