How to impement a delay in matab on real time signals
조회 수: 1 (최근 30일)
이전 댓글 표시
I am working on control systems and input requires a delay of the following kinds d[k+1] in real time how can i implement a delay of this kind
댓글 수: 0
답변 (1개)
Rick Rosson
2012년 4월 7일
function y = delay(x)
persistent n z
[ L, M ] = size(x);
if isempty(z)
n = ...
z = zeros(n,M);
end
if L == n
y = z;
z = x;
else
if L > n
y = [ z ; x(1:L-n,:) ];
z = x(L-n+1:L,:);
else
y = z(1:L,:);
z = [ z(L+1:n,:) ; x ];
end
end
end
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!