Error when trying to run a function

1 vue (au cours des 30 derniers jours)
JEDIDI Ran
JEDIDI Ran le 4 Juin 2020
Commenté : David Hill le 4 Juin 2020
i wrote that function alone in a file
function [g] = R(a,b,c,d)
rou=880;
Cd=0.7;
Aorifice=1.963495408*(10^(-5));
Vo=7*10^(-5);
Beta=1600*(10^5);
Ap=(5.026548246)*10^(-3);
g=(Beta/(Vo+b))*(sign(a-d)*Cd*Aorifice*sqrt(2*abs(a-d)/rou)-(Ap*c));
end
but when i run it i get that error "Not enough input arguments."
i don't find what missing here ?

Réponses (1)

David Hill
David Hill le 4 Juin 2020
function [g] = R(a,b,c,d)
rou=880;
Cd=0.7;
Aorifice=1.963495408*(10^(-5));
Vo=7*10^(-5);
Beta=1600*(10^5);
Ap=(5.026548246)*10^(-3);
g=(Beta/(Vo+b))*(sign(a-d)*Cd*Aorifice*sqrt(2*abs(a-d)/rou)-(Ap*c));
end
Nothing wrong there...how are you executing your function?
g=R(1,2,3,4);%need to provide 4 inputs.
  2 commentaires
JEDIDI Ran
JEDIDI Ran le 4 Juin 2020
i insered this function in another code and i get weird results, u're right the problem is not in this function
David Hill
David Hill le 4 Juin 2020
If you do not provide any additional information, we cannot help you.

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB Coder dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by