Error: not enough input arguments

Fermé
indienne - 16 oct. 2015 à 16:58
 indienne - 16 oct. 2015 à 17:16
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 726 Date d'inscription samedi 14 juin 2014 Statut Membre Dernière intervention 28 octobre 2020 77
Modifié par makitoch le 16/10/2015 à 17:14
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
Error: File: Untitledsaturforum.m Line: 2 Column: 1
Function definitions are not permitted in this context.
0