The signal relationship of the MC

function [yWin,zn,w1]=targmc(yPrev,y,b,n,order,w,z)

% Select the data window for this iteration
if n <= order % feed in supplied past values ahead of z
yWin = [yPrev(end-order+n+1:end,:); y(1:n,:)];
else % need only data from given z
yWin = y(n-order+1:n,:);
end
%initial w, and calculate output y
z(n) = b(n) – sum(diag(w’*yWin));

%check y inf or not
if ~isfinite(z(n)), error(‘Output has blown up’), end
zn=z;
w1=w;
end