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