x[t] is a discrete time periodic signal defined as follows over one period
x[t] = {1 , 2 , 1 , 2 , 3 , 1 , 2 , 3 , 4.....}
I want to generate this as a periodic signal in the interval [0,100] in Matlab. But, I am unable to write a code for this.
x[t] is a discrete time periodic signal defined as follows over one period
x[t] = {1 , 2 , 1 , 2 , 3 , 1 , 2 , 3 , 4.....}
I want to generate this as a periodic signal in the interval [0,100] in Matlab. But, I am unable to write a code for this.
In matlab if you want to generate a periodic signal there many methods one of them is :
%x is array that represent discrete time signal.
%y is generated periodic signal
%n the number of periods
temp=x'*ones(1,n);
y=temp(:);
% where x' is transpose of x.
% if we suppose x=[1,2,3]
% if we want to repeat it five times we can say n = 5
% then temp will equal [ 1 1 1 1 1
% 2 2 2 2 2
% 3 3 3 3 3]
%fianlly y will equal [1 2 3 1 2 3 1 2 3 1 2 3 1 2 3]
Maybe you can try
arrayfun
like belowwhich gives