How to continue the matrix pattern
显示 更早的评论
<< I am trying to continue the square wave below for a project and I got my code to get the first 2 peaks as seen below, but I cannot seem to make it continue in my for loop. I just want it to continue till some defined distance X. Any help would be great. Thank you all for the help.
<<


>>
>>
回答(1 个)
Star Strider
2018-3-15
0 个投票
I can barely read your code and I can’t run the image you posted.
2 个评论
Grant Gibson
2018-3-15
Star Strider
2018-3-15
Lacking the values for the constants.
I intended something like this:
v = [0 0 1 1 1 1 0 0];
t = 0:numel(v)-1;
vr = repmat(v, 1, 10);
tr = 0:numel(vr)-1;
figure(1)
subplot(2,1,1)
plot(t, v)
axis([xlim -0.1 1.1])
subplot(2,1,2)
plot(tr, vr)
axis([xlim -0.1 1.1])
Substitute ‘pattern’ for ‘v’.
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!