I need to repeat two signals combined periodically as a single curve in matlab

4 Ansichten (letzte 30 Tage)
Hi Friends
I want to get a graph of y vs t. This graph should have pattern in the form of a sine wave and straight line pattern connected periodically. Example, from t=0 to t=5 curve pattern is sine wave then from t=5 to t=10 pattern is is straight line then from t=10 to t=15 pattern is sine wave and from t=15 to t=20 pattern is a straight line and so on.
I want to plot that graph of such pattern in Matlab using m-file or using simuling block.
Someone Please help.Its urgent

Akzeptierte Antwort

sixwwwwww
sixwwwwww am 6 Dez. 2013
you can do something like this:
for i = 0:4 * pi:16 * pi
t1 = linspace(i, i + 2 * pi, 100);
y1 = sin(t1);
t2 = linspace(i + 2 * pi, i + 4 * pi, 100);
y2 = zeros(1, numel(t2));
plot(t1, y1, t2, y2), hold on
end

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots 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