Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Not enough input arguments

1 visualización (últimos 30 días)
Alessandro Caverzan
Alessandro Caverzan el 22 de Oct. de 2019
Cerrada: MATLAB Answer Bot el 20 de Ag. de 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 comentario
Sai Bhargav Avula
Sai Bhargav Avula el 17 de Feb. de 2020
Hi,
Can you provide details, How are you passing the arguments to the function?

Respuestas (1)

Jon
Jon el 17 de Feb. de 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.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by