%Skaleringsmatrise for step.

z=ones(41,1);
for i=1:4,
  z(i)=Y(i)*0.1;
end

z(5)=2.5;
z(6)=Y(6)*.1;
z(7)=95;
z(8)=15.22;
z(9)=2.5;
z(10)=Y(10)*.1;
z(11)=2.5;
z(12)=20.22;
z(13)=95;
z(14)=Y(14)*.2;
z(15)=19.79;
z(16)=95;
z(17)=2.91;
z(18)=2.5;
z(19)=Y(19)*.01;
z(20)=Y(20)*.1;
z(21)=2.5;
z(22)=2.5;

z(31)=4.0;
z(40)=.25;
z(41)=.25;
z

SkalYstep=diag(z);

l=ones(12,1);

%l(1)=100-U(1);
%l(2)=100-U(2);
%l(3)=U(3);
%l(4)=100-U(4);

l(1)=U(1)*.1;
l(2)=U(2)*.1;
l(3)=U(3)*.1;
l(4)=U(4)*.1;

l(5)=U(5);
l(6)=U(6);
l(7)=U(7);
l(8)=U(8);
l(9)=U(9);
l(10)=U(10);
l(11)=U(11);
l(12)=100-U(12);

SkalUstep=diag(l);

% Beregner de skalerte matrisene

cs=inv(SkalYstep)*c;           
ds=inv(SkalYstep)*d*(SkalUstep);
bs=b*(SkalUstep);        
as=a;                

stepsys=ss(as,bs,cs,ds);




