Info

This question is closed. Reopen it to edit or answer.

Not enough input arguments

1 view (last 30 days)
Alessandro Caverzan
Alessandro Caverzan on 22 Oct 2019
Closed: MATLAB Answer Bot on 20 Aug 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 Comment
Sai Bhargav Avula
Sai Bhargav Avula on 17 Feb 2020
Hi,
Can you provide details, How are you passing the arguments to the function?

Answers (1)

Jon
Jon on 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!