how to plot data more than one time?

I have a data of a sequence y = [0 1 1 1 0 0 1 0 1 0] and I would like to plot it 20 times in one figure but the first time will be from (0-9) the second time will be from (10-19) and so one which means that starting point of the new one is the ending point of the previous one plus one, so if the previous one ends at 9 the new one starts at 10.
later I will need to do it more than 20 time .

回答 (1 件)

dpb
dpb 2019 年 12 月 16 日

0 投票

N=20;
plot([0:N*numel(y)-1],repmat(y,1,N))

2 件のコメント

ahmed abdelmgeed
ahmed abdelmgeed 2019 年 12 月 16 日
thank you for your help, and whay if I want the starting point of the new array is the ending point of the previous one plus one so if the previous one ends at 9 the new one starts at 10.
dpb
dpb 2019 年 12 月 16 日
It does. Expand the plot and/or retrieve XData, YData and examine it.

この質問は閉じられています。

タグ

質問済み:

2019 年 12 月 16 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by