Chopping a wave(signal)

I have a long waveform but i am interested in a small segment of the waveform.How do I chop the signal in matlab?

Answers (1)

Can you clarify? Could be very simple.
t=0:0.1:10;
signal=sin(t);figure(1);plot(signal);
NewSignal=signal(1:50);figure(2);plot(NewSignal);

2 Comments

instead of the signal(1:50) we can use the time vector like this
signal(t<=5) %just the first five seconds
Nice, that could facilitating a better plot (with the right x axle mark). Thanks!
Selection=(t>1) & (t<6)
plot(t(Selection),signal(Selection));

Sign in to comment.

Categories

Asked:

on 9 Jun 2011

Community Treasure Hunt

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

Start Hunting!