How to plot a piecewise function for single cycle? Then repeat the same graph for several times.
2 ビュー (過去 30 日間)
古いコメントを表示
How to plot a piecewise function for single cycle? Then repeat the same graph for several times.
2 件のコメント
回答 (1 件)
Asad (Mehrzad) Khoddam
2020 年 10 月 13 日
This is a sample of function that repeats the graph:
% initial x
x0=-1;
% period
T=4;
xp=linspace(x0,x0+T,201);
% function
yp=sin(sqrt(2+xp));
x=[];
y=[];
% repeat it
for i=-3:2
x=[x xp+T*i];
y=[y yp];
end
plot(x,y)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!