Error: not enough input arguments

indienne -  
 indienne -
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

makitoch Messages postés 730 Date d'inscription   Statut Membre Dernière intervention   78
 
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
0
indienne
 
Error: File: Untitledsaturforum.m Line: 2 Column: 1
Function definitions are not permitted in this context.
0