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

1 次查看(过去 30 天)
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

采纳的回答

sixwwwwww
sixwwwwww 2013-12-6
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by