% Solution proposal Task 13
% Updated: 15.02.2023

% generate some data matrices Y and U to be used for testing purposes
A=0.9; B=0.5; D=1; E=-1;     % Model parameters

N=200;
U=prbs1(N,10,40);
Y=dsrsim(A,B,D,E,U)+randn(N,1)*1.5;
ny=size(Y,2);

% Parameters for DSR
L=5; g=1; J=2;

idemo=1;
idemo=dread('Idemo (DSR =1 or MYDSR 2))',idemo);

if idemo==1
    disp('DSR ')
 [a,b,d,e,c,f,x0]=dsr(Y,U,L,g,J);
elseif idemo==2
    disp('MYDSR')
 [a,b,d,e,x0]=mydsr(Y,U,L,g,J);
end