Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Not enough input arguments

조회 수: 1 (최근 30일)
Alessandro Caverzan
Alessandro Caverzan 2019년 10월 22일
마감: MATLAB Answer Bot 2021년 8월 20일
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
Sai Bhargav Avula
Sai Bhargav Avula 2020년 2월 17일
Hi,
Can you provide details, How are you passing the arguments to the function?

답변 (1개)

Jon
Jon 2020년 2월 17일
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