Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Not enough input arguments

1 visualizzazione (ultimi 30 giorni)
Alessandro Caverzan
Alessandro Caverzan il 22 Ott 2019
Chiuso: MATLAB Answer Bot il 20 Ago 2021
Somebody help... this is my code:
% --- Estado Estable CIA --- %
function [f] = foc_cia(x)
global alpha beta delta eta psi fi theta_ss y_ss c_ss n_ss k_ss lambda_ss miu_ss i_ss r_ss
c_ss=x(1) ;
n_ss=x(2) ;
k_ss=x(3) ;
lambda_ss = x(4);
miu_ss = x(5) ;
%Condiciones de primer orden
f(1) = (c_ss^fi) - lambda_ss - miu_ss;
f(2) = psi*((1+n_ss)^eta) - lambda_ss*(1-alpha)*(y_ss/n_ss);
f(3) = -lambda_ss + beta*(1+r_ss)*lambda_ss;
f(4) = - miu_ss + i_ss*lambda_ss ;
f(5)= -lambda_ss + beta*((lambda_ss + miu_ss)/(1 + theta_ss));
...and the error
Not enough input arguments.
Error in foc_cia (line 5)
c_ss=x(1)
  1 Commento
Sai Bhargav Avula
Sai Bhargav Avula il 17 Feb 2020
Hi,
Can you provide details, How are you passing the arguments to the function?

Risposte (1)

Jon
Jon il 17 Feb 2020
The 'Not enough input arguments' error message means that when you call the function foc_cia you are not providing the correct number of arguments. In this case as you have defined your function foc_cia, it needs to have exactly one argument. So look in your code where you are calling the function (not in the code where the function is defined) and you will probably see something like (I'm not sure what your left hand variable will be I'm just calling it y
y = fuc_cia
or
y = fuc_cia()
when it should be
y = fuc_cia(x) % doesn't matter whether the variable is called 'x' but you need to have one argument.

Community Treasure Hunt

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

Start Hunting!

Translated by