How to shrink time scale for discrete signal?
2 次查看(过去 30 天)
显示 更早的评论
%if
bits = [1,0,1,1,0,0,0,1];
% Mapping
for a=1:length(bits)
if bits(a) == 1
bit(a) = 5;
else
bit(a) = -5;
end
end
i = 1;
t = 0:0.01:length(bits);
for b=1:length(t)
if t(b) <= i
y(b) = bit(i);
else
y(b) = bit(i);
i = i+1;
end
end
plot(t,y);
end
I am trying to change the duration of 1 bit from 1s to 1us and the scale would be 0 to 8us with a step of 1e-8. I am getting an error if I do it using this method and if I specify my own time scale it will only print the first value that goes from 0 to 1. Any ideas???
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!