IRF: too many inputs arguments?!!!!

Hey every body,
Please I am runing the code for fig03 but it show the following error:
Error using irf
Too many input arguments.
Error in fig03 (line 160)
Yo0 = irf(1, nir+1, Do, zeros(7, ns), Go, Ho);
I said that because it is irf2 needed and not irf as mentioned in the comments of the code but another kind of error raises:
Error using zeros
Size inputs must be scalar.
Error in irf2 (line 31)
K = zeros(NK, NIR);
Error in fig03 (line 160)
Yo0 = irf2(1, nir+1, Do, zeros(7, ns), Go, Ho);
any help from the matlab community is more than welcome
Houda

回答 (1 件)

KSSV
KSSV 2017 年 9 月 5 日

0 投票

This line:
Yo0 = irf2(1, nir+1, Do, zeros(7, ns), Go, Ho) ;
YOu cannot input variables like that.
Use:
N = 1 ;
ZZ = zeros(7,ns) ;
Yo0 = irf2(N, nir+1, Do, zZ, Go, Ho)
But this will arise different errors now in irf2...:)

7 件のコメント

Walter Roberson
Walter Roberson 2017 年 9 月 5 日
This is incorrect. It is fine to use function results instead of variables in nearly all cases. The situation with calling zeros there is the same as the situation with passing in nir+1, both are the result of expressions
KSSV
KSSV 2017 年 9 月 5 日
I tried passing zeros(7,ns), but code trowed error...it accepted input's as a variable.
Houda
Houda 2017 年 9 月 5 日
Hey KSSV, I followed your suggestions by adding the three lines and using the irf2 not irf but the problem is here with different error messages but the figure is not drawing. thanks for your help
KSSV
KSSV 2017 年 9 月 5 日
I already mentioned it will give different error messages. :)
Walter Roberson
Walter Roberson 2017 年 9 月 5 日
What are some sample inputs to test with?
Houda
Houda 2017 年 9 月 6 日
編集済み: Houda 2017 年 9 月 6 日
Good morning, Dear @Walter Robenson I didn't understand your question, but I attached the whole zipped file with data and codes above. thanks
Walter Roberson
Walter Roberson 2017 年 9 月 6 日
fig03 is a function that needs to be passed parameters. What parameters are you passing to it?

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeApp Building についてさらに検索

質問済み:

2017 年 9 月 5 日

コメント済み:

2017 年 9 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by