Filter löschen
Filter löschen

How to impement a delay in matab on real time signals

1 Ansicht (letzte 30 Tage)
muwahida liaquat
muwahida liaquat am 7 Apr. 2012
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

Antworten (1)

Rick Rosson
Rick Rosson am 7 Apr. 2012
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

Kategorien

Mehr zu Simulink finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by