%beer lambert's law

%creating an output structure similar to input
OutputPort1 = InputPort1;

A = Parameter0;
Z = Parameter1;
[ls, cs] = size(InputPort1.Sampled);

if( ls > 0 )
% caculate the attenuation at each signal
    for counter1=1:cs-1
        if (InputPort1.Sampled(1,counter1).Signal>InputPort1.Sampled(1,counter1+1).Signal)
            I0=max(InputPort1.Sampled(1,counter1).Signal);
        else
            I0=max(InputPort1.Sampled(1,counter1+1).Signal);
        end
        OutputPort1.Sampled.Signal = I0*exp(-1*A*Z);
    end
end
