Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
plotting vectors into step functions

Subject: plotting vectors into step functions

From: Nee Gulvadi

Date: 2 Nov, 2013 15:51:08

Message: 1 of 2

Hello,

I want to create heaviside functions that go randomly either 1 to -1 with the square wave having a period of 2 seconds. I have already generated the random numbers into a vector such as [1 -1 1 1 -1] etc. So how do I plot this vector now into a step function? I want to do it in heaviside functions.. I can get the plot of the vector but can't get step functions it just connects the points. Also it starts at 1 and not 0 and I need it to start at 0. If someone could help me that would be great.. I also will need to end up integrating this wave into triangle wave at the right times but I should be able to figure that out.

Thanks, Nee

Subject: plotting vectors into step functions

From: TideMan

Date: 2 Nov, 2013 19:49:50

Message: 2 of 2

On Sunday, November 3, 2013 4:51:08 AM UTC+13, Nee Gulvadi wrote:
> Hello,
>
>
>
> I want to create heaviside functions that go randomly either 1 to -1 with the square wave having a period of 2 seconds. I have already generated the random numbers into a vector such as [1 -1 1 1 -1] etc. So how do I plot this vector now into a step function? I want to do it in heaviside functions.. I can get the plot of the vector but can't get step functions it just connects the points. Also it starts at 1 and not 0 and I need it to start at 0. If someone could help me that would be great.. I also will need to end up integrating this wave into triangle wave at the right times but I should be able to figure that out.
>
>
>
> Thanks, Nee

help stairs

Tags for this Thread

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.

Contact us