Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

square (MathScript RT Module Function)

LabVIEW 2010 Help

Edition Date: June 2010

Part Number: 371361G-01

»View Product Info

Owning Class: waveform generation

Requires: MathScript RT Module

Syntax

s = square(t)

s = square(t, d)

Description

Generates a square wave with period 2*pi.

Examples

Inputs

Name Description
t Specifies the times at which to plot data for the square wave. t is a vector.
d Specifies the duty cycle percentage of the square wave, or the percentage of high data in the square wave. d is a scalar between 0 and 100. The default is 50.

Outputs

Name Description
s Returns the square wave at times t with period 2*pi and duty cycle d. s is a vector.

Examples

X = 0:0.01:6*pi;
Y = square(X, 30);
plot(X, Y)

Related Topics

gensignal
sawtooth


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit