Error: not enough input arguments

help , I'm very new to MATLAB!! I am trying to run this code, however, i get error, that there is error in line 3: not enough input arguments :(

function a = satur(u)

if abs(u)> 0.001
a= sign(u);
else
a= u*1000;
end
end

1 réponse

  1. try like that :

    if abs(u)> 0.001
    function a = satur(u)
    a= sign(u);
    end
    else
    function a = satur(u)
    a= u*1000;
    end
    1. Error: File: Untitledsaturforum.m Line: 2 Column: 1
      Function definitions are not permitted in this context.