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!