Error when trying to run a function

1 visualizzazione (ultimi 30 giorni)
JEDIDI Ran
JEDIDI Ran il 4 Giu 2020
Commentato: David Hill il 4 Giu 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 ?

Risposte (1)

David Hill
David Hill il 4 Giu 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 Commenti
JEDIDI Ran
JEDIDI Ran il 4 Giu 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 il 4 Giu 2020
If you do not provide any additional information, we cannot help you.

Accedi per commentare.

Categorie

Scopri di più su MATLAB Coder in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by