function transformace_5f(block)

setup(block);
  
%endfunction

function setup(block)
  
  % Register number of ports
  block.NumInputPorts  = 2;
  block.NumOutputPorts = 5;

  % Setup port properties to be inherited or dynamic
  block.SetPreCompInpPortInfoToDynamic;
  block.SetPreCompOutPortInfoToDynamic;


  % Register parameters
  block.NumDialogPrms = 1;
  
   % Setup the continous state
  block.NumContStates = 0;

  % Register sample times
  %  [0 offset]            : Continuous sample time
  %  [positive_num offset] : Discrete sample time
  %
  %  [-1, 0]               : Inherited sample time
  %  [-2, 0]               : Variable sample time
  
  block.SampleTimes = [0 0];


  % Register block methods
  block.RegBlockMethod('InitializeConditions',    @InitConditions);
  block.RegBlockMethod('Outputs',                 @Output);  
  block.RegBlockMethod('Derivatives',             @Derivatives);
  block.RegBlockMethod('SetInputPortSamplingMode',@SetInpPortFrameData);
  
%endfunction

function InitConditions(block)

  
%endfunction

function Output(block)
% 

  
  uhel = block.DialogPrm(1).Data;
  
  Xalfa1 = block.InputPort(1).Data;
  Xbeta1 = block.InputPort(2).Data;
  
  Xalfa = Xalfa1;
  Xbeta = Xbeta1;
  
  block.OutputPort(1).Data = cos(0)*Xalfa + sin(0)*Xbeta;
  block.OutputPort(2).Data = cos(2*pi/5)*Xalfa + sin(2*pi/5)*Xbeta;
  block.OutputPort(3).Data = cos(4*pi/5)*Xalfa + sin(4*pi/5)*Xbeta;
  block.OutputPort(4).Data = cos(6*pi/5)*Xalfa + sin(6*pi/5)*Xbeta;
  block.OutputPort(5).Data = cos(8*pi/5)*Xalfa + sin(8*pi/5)*Xbeta;
  
  
%endfunction

function Derivatives(block)
% 

function SetInpPortFrameData(block,idx,fd)

block.InputPort(idx).SamplingMode = fd;
for i = 1:block.NumOutputPorts
    block.OutputPort(i).SamplingMode = fd;
end
%endfunction