Put a given sequence on time slots

3 次查看(过去 30 天)
For example, I have 48-time slots (t) and I want to put a block of a sequence [1,1,0,0] on these time slots randomly from (t+n) to (t+n+4). How can i generate such a sequence.

采纳的回答

Walter Roberson
Walter Roberson 2018-10-12
n = randi(length(t) - 3)
t(n:n+3) = [1 1 0 0]
  4 个评论
Hiba Haider
Hiba Haider 2023-1-20
hello dear
same idea i have 24 slot for example i want choose one slot from slot 11 to slot 22 how can i apply

请先登录,再进行评论。

更多回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by