Filter löschen
Filter löschen

Generating Step Function In MATLAB.

11 Ansichten (letzte 30 Tage)
Pranjal Pathak
Pranjal Pathak am 5 Jan. 2012
Hi, Can anyone help me in generating a step function which increases by an increment of 1 unit and then remain constant for 1 unit and then again increases by 1 unit,remain constant for 1 unit and so on (upto a certain height,say 5 unit) and then again decreasing by the same amount, remaining constant for the same amount as while increasing, in MATLAB? Thanking You!

Akzeptierte Antwort

k.v.swamy
k.v.swamy am 5 Jan. 2012
try this code N=21; x=0:N-1; y=5*ones(1,N) stem(x,y)

Weitere Antworten (1)

Titus Edelhofer
Titus Edelhofer am 5 Jan. 2012
Hi Pranjal,
take a look at the function stairs that makes this task rather simple ...
Titus

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by