Your code does not define fq in the case that qp is nan.
When you are constructing MATLAB Function blocks, it is safest to start by assigning the output zeros() of the appropriate size and data type.
I also recommend that you code as
if qp == 0
if abs(tao)< fs
fq = fs;
else
fq = fs * sign(tao);
end
else
fq = fk;
end
this makes it obvious to the compiler that fq is assigned in every possible branch. (But give some thought to handling nan anyhow.)
