can you help me create the program for plotting the graph of this discontinuous signal equation?

Answers (1)

Please try the following steps:
1. Decide on a sampling rate Fs in samples per second, or alternatively, decide on a time increment dt in seconds per sample. Once you choose one or the other of these parameters, then compute the second parameter as the reciprocal. For example:
Fs = 100; % samples per second
dt = 1/Fs; % seconds per sample
2. Define the time domain based on the time increment, the start time, and the stop time:
StartTime = 0;
StopTime = 2;
t = StartTime:dt:StopTime-dt;
3. Create two signals x and y, one for each of the two equations that you want to represent:
x = 2*t;
y = (4-2*t)/3;
4. Create a logical signal (valued at 0 or 1) to distinguish between the two time regions that define which of the two equations is in play:
u = (t<0.5);
5. Create the final signal S from the two separate signals x and y, and the locical control signal u.
HTH.

Categories

Find more on Graphics Objects in Help Center and File Exchange

Asked:

on 4 Jul 2011

Community Treasure Hunt

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

Start Hunting!