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

1 回表示 (過去 30 日間)
Michael Bernard
Michael Bernard 2013 年 12 月 6 日
回答済み: sixwwwwww 2013 年 12 月 6 日
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 Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by