Thread Subject: Plot with step shape

Subject: Plot with step shape

From: Jonas Baumann

Date: 8 Oct, 2009 14:22:03

Message: 1 of 4

Is there an easy ellegant way to plot(t,x) but with (t1,x1)->(t2,x2) not connected but rather leaving x constant at x1 between t1 and t2, then stepping x to x2, again leaving it constant from t2 to t3 and so on?

thanks in advance for the help

Subject: Plot with step shape

From: Steven Lord

Date: 8 Oct, 2009 14:36:42

Message: 2 of 4


"Jonas Baumann" <baumann.jonas@gmail.com> wrote in message
news:haksib$5t4$1@fred.mathworks.com...
> Is there an easy ellegant way to plot(t,x) but with (t1,x1)->(t2,x2) not
> connected but rather leaving x constant at x1 between t1 and t2, then
> stepping x to x2, again leaving it constant from t2 to t3 and so on?

From your description, it sounds like you want the STAIRS function.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Subject: Plot with step shape

From: PinkLab

Date: 8 Oct, 2009 15:46:18

Message: 3 of 4

Steve, do you know how to plot a impulse graph without using impulse function?

"Steven Lord" <slord@mathworks.com> wrote in message <haktcs$2lv$1@fred.mathworks.com>...
>
> "Jonas Baumann" <baumann.jonas@gmail.com> wrote in message
> news:haksib$5t4$1@fred.mathworks.com...
> > Is there an easy ellegant way to plot(t,x) but with (t1,x1)->(t2,x2) not
> > connected but rather leaving x constant at x1 between t1 and t2, then
> > stepping x to x2, again leaving it constant from t2 to t3 and so on?
>
> From your description, it sounds like you want the STAIRS function.
>
> --
> Steve Lord
> slord@mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
>

Subject: Plot with step shape

From: Steven Lord

Date: 8 Oct, 2009 17:09:41

Message: 4 of 4


"PinkLab " <hussains_k@hotmail.com> wrote in message
news:hal1g9$d9d$1@fred.mathworks.com...
> Steve, do you know how to plot a impulse graph without using impulse
> function?

Please try to keep one topic per thread and one thread per topic.

If by impulse you mean the Dirac delta function:

http://en.wikipedia.org/wiki/Dirac_delta_function

one approximation is:

line([-1 0 0 0 1], [0 0 1 0 0]);
set(gca, 'YLim', [-0.5 1.5], 'YTick', [0 1], 'YTickLabel', {'0', 'Inf'})

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com