How to shrink time scale for discrete signal?

2 ビュー (過去 30 日間)
Himanshu Sharma
Himanshu Sharma 2018 年 11 月 4 日
%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 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by